Components / Layout and type
Divider
Horizontal or vertical separator line, with an optional label in the middle.
import { Divider } from "@stylhero/ui";
Example
Code
import { Divider, Stack, Text } from "@stylhero/ui";
function DividerExample() {
return (
<Stack gap={4}>
<Text>Above</Text>
<Divider />
<Divider label="or" />
<Stack direction="row" gap={3} align="center"><Text>Left</Text><Divider orientation="vertical" /><Text>Right</Text></Stack>
</Stack>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label |
ReactNode |
- | Text in the middle of a horizontal divider, e.g. "or". |
orientation |
"horizontal" | "vertical" |
"horizontal" |
Also takes the HTML attributes of its root element (id, style, data-*, aria-*, event handlers…).
Accessibility
role="separator"witharia-orientation.
Generated from src/components/Divider.tsx. Something wrong or missing? Open an issue.