Separator
A horizontal or vertical rule.
Horizontal
Release 4.2Shipped on Tuesday with 14 changes.
Release 4.1Shipped two weeks earlier with 9 changes.
import { Separator } from "@/components/ui/separator"
export default function SeparatorHorizontal() {
return (
<div className="flex w-full max-w-sm flex-col gap-3 text-sm">
<div className="flex flex-col gap-1">
<span className="font-medium">Release 4.2</span>
<span className="text-muted-foreground">Shipped on Tuesday with 14 changes.</span>
</div>
<Separator />
<div className="flex flex-col gap-1">
<span className="font-medium">Release 4.1</span>
<span className="text-muted-foreground">Shipped two weeks earlier with 9 changes.</span>
</div>
</div>
)
}
Vertical
14 tasks3 invoices2 releases
import { Separator } from "@/components/ui/separator"
export default function SeparatorVertical() {
return (
<div className="flex h-5 items-center gap-3 text-sm">
<span>14 tasks</span>
<Separator orientation="vertical" />
<span>3 invoices</span>
<Separator orientation="vertical" />
<span>2 releases</span>
</div>
)
}
Installation
npx shadcn@latest add @khaeli/separatorbunx --bun shadcn@latest add @khaeli/separatorInstall @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.
Installs with
- Registry items
- npm packages
- @base-ui/react ^1.7.0
Accessible name
- A separator has
role="separator"and needs no name. A vertical one also hasaria-orientation="vertical". - A vertical separator stretches to its row, so the row needs a height.
Registry JSON
The item as the shadcn CLI reads it, with every file it ships: https://ui.khaeli.com/r/separator.json