Base · Data display
Separator
A thin line that divides content into groups.
HTML / JSPlannedReactStableReact NativeDraftSwift (SwiftUI)PlannedGodotPlannedVueDraftSvelteDraftSolidDraft
Reviewed
Shipment PDC-4821Rotterdam to Duisburg by rail
18 palletsArrives Thursday
Props
tsx
import { Separator } from "@/components/ui/separator"
<div>Shipment PDC-4821</div>
<Separator />
<div>18 pallets</div>Overview
A separator is a 1px rule in the border color, horizontal or vertical. It marks a boundary between groups of related content and is exposed to assistive technology as a separator.
When to use
- Between groups of items in a menu, toolbar or list.
- Vertically between inline items of metadata, such as shipment ID, pallet count and arrival day.
- Between sections of a panel where spacing alone does not make the grouping clear.
When not to use
- When whitespace or a heading already separates the groups: extra lines add noise.
- To frame content on all sides: use a Card or a border.
- Between table rows: Table draws its own row borders.
Anatomy
Line
A 1px rule. Full width when horizontal; stretches to the height of its flex parent when vertical.
Props
The contract every language implements. Names follow each language’s conventions (camelCase in React, snake_case in Rust).
| Prop | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" | "vertical" | horizontal | Direction of the line. A vertical separator needs a flex parent with a height. |
| title | string | Shipment PDC-4821 | Text of the first content block in the demo. Not a Separator prop. |
States
- Rest
- The only state. A separator is not interactive.
Accessibility
Role: separator
- Renders with role="separator" and aria-orientation, so screen readers can announce the boundary.
- If the line is purely decorative, hide it with aria-hidden="true" to avoid extra announcements in dense layouts.
- The line meets non-text contrast only loosely by design; do not rely on it as the sole cue for an important grouping.
Design tokens
Change any of these in Foundations and this component follows, in every language.
Platform notes
- HTML / JS
- Planned
- Not built in HTML / JS yet.
- React
- Stable
- Matches the contract with no platform differences.
- React Native
- Draft
- A View with a 1pt line in the border colour, hidden from screen readers unless `decorative={false}`, which gives it the separator role.
- Swift (SwiftUI)
- Planned
- Not built in Swift yet.
- Godot
- Planned
- Not built in Godot yet.
- Vue
- Draft
- Usage snippet only; same props and behavior as the React component.
- Svelte
- Draft
- Usage snippet only (Svelte 5); same props and behavior as the React component.
- Solid
- Draft
- Usage snippet only; same props and behavior as the React component.