Section separator is a divider line that compartmentalizes content, typically used on cards or white backgrounds. This should only be used on light backgrounds (with our variable $bg_light
).
import React from 'react' import SectionSeparator from 'playbook-ui' import Flex from 'playbook-ui' import FlexItem from 'playbook-ui' const SectionSeparatorVertical = (props) => { return ( <Flex inline="flex-container" vertical="stretch" > <FlexItem> {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'} </FlexItem> <SectionSeparator orientation="vertical" /> <FlexItem> {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'} </FlexItem> <SectionSeparator orientation="vertical" /> <FlexItem> {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'} </FlexItem> </Flex> ) } export default SectionSeparatorVertical
Pass anything (including any of our kits) to the children
prop to customize a separator's content.
NOTE: passing children
overrides any content passed to text
import React from 'react' import { SectionSeparator, Card, Caption } from 'playbook-ui' const children = ( <Card borderRadius="rounded" justifyContent="center" padding="none" > <Caption paddingLeft="xs" paddingRight="xs" size="xs" text="TODAY" /> </Card> ) const SectionSeparatorChildren = (props) => { return ( <SectionSeparator lineStyle='dashed' > {children} </SectionSeparator> ) } export default SectionSeparatorChildren
Pass "primary" to the color
prop to change any section separator color.
NOTE: Passing children
overrides any content provided via the text
prop. The color
prop does not affect the text
prop's color, and the color of children
is determined by the children's individual props. For greater control over text color customization, consider using a separator with children
.
import React from "react" import { SectionSeparator, Flex, Detail, Icon } from "playbook-ui" const children = ( <Flex padding="xs"> <Icon color="primary" icon="arrow-down" /> <Detail color="link" size="sm" text="Children" /> </Flex> ) const SectionSeparatorColor = (props) => { return ( <div> <SectionSeparator text="Default Separator" /> <SectionSeparator color="primary" text="Primary Separator" /> <SectionSeparator color="primary" lineStyle="dashed" text="Primary Dashed Separator" /> <SectionSeparator color="primary" > {children} </SectionSeparator> </div> ) } export default SectionSeparatorColor