A visual divider that separates content horizontally or vertically.
A thin line used to visually separate content into distinct sections. Built on Base UI's Separator primitive, it supports both horizontal and vertical orientations.
A component library built with Base UI.
import { Separator } from "@/components/ui/separator"
export default function SeparatorDemo() {
return (
<div>
<div className="space-y-1">
<h4 className="text-sm font-medium">Toro UI</h4>
<p className="text-sm text-muted-foreground">
A component library built with Base UI.
</p>
</div>
<Separator className="my-4" />
<div className="flex h-5 items-center gap-4 text-sm">
<span>Docs</span>
<Separator orientation="vertical" />
<span>Components</span>
<Separator orientation="vertical" />
<span>Themes</span>
</div>
</div>
)
}
import { Separator } from "@/components/ui/separator"<Separator />The default orientation spans the full width of its container.
<div>
<p className="text-sm">Section one</p>
<Separator className="my-4" />
<p className="text-sm">Section two</p>
</div>Use orientation="vertical" for inline separation. The separator stretches to fill its parent's height via self-stretch.
<div className="flex h-5 items-center gap-4 text-sm">
<span>Blog</span>
<Separator orientation="vertical" />
<span>Docs</span>
<Separator orientation="vertical" />
<span>Source</span>
</div>Renders a <div> with a separator role via Base UI's Separator primitive.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "horizontal" | The axis along which the line is drawn. |
className | string | — |