ToroUI

Separator

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.

Toro UI

A component library built with Base UI.

DocsComponentsThemes
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>
  )
}

Anatomy

import { Separator } from "@/components/ui/separator"
<Separator />

Examples

Horizontal 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>

Vertical separator

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>

API Reference

Separator

Renders a <div> with a separator role via Base UI's Separator primitive.

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"The axis along which the line is drawn.
classNamestring