Separator
A thin line that divides groups of content, horizontal between stacked sections or vertical between items in a row.
orientation
<Separator decorative orientation="horizontal" />When to use
- To divide two groups of different kinds inside one block, such as the process data and the reviewer data in a card.
- To split items in a toolbar or a breadcrumb-like row with a vertical line.
- To mark a real boundary between sections, with
decorative={false}.
The manifesto asks for structure you can scan: related items sit together, and groups are separated by space and strokes, not by color. A separator is the stroke.
When not to use
- Between every item of a list. Use spacing. Lines on every row turn into noise and make the groups harder to see.
- A visible edge around a block. Use a
Cardor a border on the container. - A section with a heading. Use the heading and spacing. A heading already separates.
- Resizing two panels. Use
Resizable, whose handle is also a line.
Orientations
Processo 0001234-56.2024.8.26.0100
Revisor: Marina Costa
| Orientation | Size | Use for |
|---|---|---|
horizontal |
1px high, full width | Default. Between stacked groups. |
vertical |
1px wide, full height | Between items in a row. The parent needs a height, for example h-5. |
Examples
As a boundary for assistive technology
By default the line is decorative and hidden from screen readers. Set decorative={false} when it divides two real sections.
Do and don’t
Número: 0001234-56.2024
Vara: 3ª Vara Cível
Revisor: Marina Costa
Prazo: 12/12/2026
Número: 0001234-56.2024
Vara: 3ª Vara Cível
Revisor: Marina Costa
Prazo: 12/12/2026
Accessibility
- Built on Radix Separator. With the default
decorative, the element getsrole="none"and assistive technology skips it. - With
decorative={false}it rendersrole="separator"witharia-orientationset when the orientation is vertical (horizontal is the implicit value). - It is not focusable and has no keyboard behavior. For a draggable divider, use
Resizable. - The line is 1px and light, so it is a visual aid only. Never carry meaning with the line alone.
Code
import { Separator } from "@repo/ui/separator";
<Separator />
<div className="flex h-5 items-center gap-3">
<span>Petição inicial</span>
<Separator orientation="vertical" />
<span>Contestação</span>
</div>
Props
Separator| Prop | Type | Default | Description |
|---|---|---|---|
decorative | boolean | true | When true, the line is hidden from assistive technology. Set it to false only when it marks a real boundary between sections |
orientation | "horizontal" | "vertical" | horizontal | Direction of the line. A vertical separator needs a parent with a height |
Known issues
| Issue | Effect |
|---|---|
The line uses bg-stroke-secondary, the neutral color at 10% opacity. |
The repository avoids transparency. On the bg-secondary gray the line is faint, below the 3:1 contrast of non-text elements. Acceptable for a decorative divider, not for one that must stand out. |
orientation="vertical" uses h-full. |
In a parent without a height the line collapses to nothing. Give the parent a height or pass className="h-5". |