Separator

A rule between sections, horizontal or vertical, optionally with a label set into it.

src/components/ui/separator.tsx

Install

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

With a label

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'>.

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'Direction of the rule. Vertical stretches to its container.
labelReactNode—Text set into the rule, e.g. "or". Horizontal only.
decorativebooleantrueHidden from assistive tech, which is right for a purely visual rule. Set false when it separates genuinely distinct regions.