Loading component…
Loading component…
A thin line between groups
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Separator from ./separator.
import { Separator } from "@/components/ui/separator";
export function RunStats() {
return (
<div style={{ display: "flex", alignItems: "center", gap: 8 }}>
<span>12 runs</span>
<Separator orientation="vertical" />
<span>1 failed</span>
</div>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| orientation | "horizontal" \| "vertical" | "horizontal" | A line across its container, or an upright line centred in its row (18px high – set height to change it) |
| label | ReactNode | A short word in the middle of a horizontal line. Long text wraps in the middle, the lines stay at least 12px | |
| decorative | boolean | true | true: only a visual line, hidden from screen readers (a label stays readable as text). false: role="separator" with aria-orientation, named after a text label |
| ...div props | ComponentProps<"div"> | className, style, id, ref and the rest go to the <div> |
The line is a border, so it stays one crisp pixel on every screen density
Logical properties – the upright line and the label follow right-to-left text
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.