Divider A component that serves as a visual divider and is used to clearly separate sections between content.
@seed-design/react@0.0.14, @seed-design/css@0.0.14
import { Box, Divider, VStack } from "@seed-design/react" ;
export default function DividerPreview () {
return (
< VStack width = "full" bg = "bg.layerDefault" p = "x4" >
< Box p = "x4" >
Nisi elit pariatur incididunt quis fugiat mollit ipsum fugiat duis culpa esse incididunt
cupidatat.
</ Box >
< Divider />
< Box p = "x4" >Consectetur voluptate quis do culpa et culpa.</ Box >
</ VStack >
);
}
import { Divider } from "@seed-design/react" ;
Divider renders <hr /> by default. <hr /> is a semantic divider, and screen readers also read the element as "horizontal (vertical) line".
If Divider is a decorative element without semantic meaning, use the as prop to render it as a <div> or similar so screen readers do not read the element.
Conversely, when Divider must be rendered as an element other than <hr /> such as <li>, if screen readers should read the element, you must explicitly specify role="separator".
import { Box, Divider, HStack, VStack } from "@seed-design/react" ;
export default function DividerOrientation () {
return (
< VStack width = "full" gap = "x4" >
< VStack flexGrow bg = "bg.layerDefault" gap = "x4" >
< Box bg = "palette.blue400" height = "x8" />
< Divider />
< Box bg = "palette.blue400" height = "x8" />
</ VStack >
< HStack flexGrow bg = "bg.layerDefault" gap = "x4" height = "x16" >
< Box bg = "palette.blue400" flexGrow />
< Divider orientation = "vertical" />
< Box bg = "palette.blue400" flexGrow />
</ HStack >
</ VStack >
);
}
import { Box, Divider, HStack, VStack } from "@seed-design/react" ;
export default function DividerInset () {
return (
< VStack width = "full" gap = "x4" >
< VStack flexGrow bg = "bg.layerDefault" gap = "x4" >
< Box bg = "palette.blue400" height = "x8" />
< Divider inset />
< Box bg = "palette.blue400" height = "x8" />
</ VStack >
< HStack flexGrow bg = "bg.layerDefault" gap = "x4" height = "x16" >
< Box bg = "palette.blue400" flexGrow />
< Divider orientation = "vertical" inset />
< Box bg = "palette.blue400" flexGrow />
</ HStack >
</ VStack >
);
}