Separator
A rule between sections, horizontal or vertical, optionally with a label set into it.
src/components/ui/separator.tsxInstall
npx astralyx-ui add separator
Usage
import { Separator } from '@/components/ui/separator'
<Separator />
<Separator label="or" />Composer
Change the props and the source below follows.
or
Props
tsx
<Separator label="or" />
Examples
Horizontal
tsx
<Separator />
With a label
tsx
<Separator label="or" />
Vertical
tsx
<Separator orientation="vertical" />
API
Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.
Separator
Extends Omit<ComponentProps<'div'>, 'children'>.
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | 'horizontal' | 'vertical' | 'horizontal' | Direction of the rule. Vertical stretches to its container. |
| label | ReactNode | — | Text set into the rule, e.g. "or". Horizontal only. |
| decorative | boolean | true | Hidden from assistive tech, which is right for a purely visual rule. Set false when it separates genuinely distinct regions. |