Skip to main content
The Separator component provides a simple line to visually divide content. It’s built on Base UI’s Separator primitive and supports horizontal and vertical orientations.

Installation

npx shadcn@latest add @eo-n/separator

Usage

Import the Separator component:
import { Separator } from "@/components/ui/separator";
<Separator />

Component API

Separator

orientation
'horizontal' | 'vertical'
default:"horizontal"
The orientation of the separator.
className
string
Additional CSS classes to apply to the separator.

Examples

Horizontal Separator

The default orientation creates a horizontal dividing line:
<div>
  <p>Content above</p>
  <Separator />
  <p>Content below</p>
</div>

Vertical Separator

Use the orientation prop for vertical separation:
<div className="flex h-20 items-center">
  <span>Left content</span>
  <Separator orientation="vertical" className="mx-4" />
  <span>Right content</span>
</div>

Custom Styling

Apply custom styles using the className prop:
<Separator className="my-8 bg-primary" />

In a Menu

<div className="space-y-2">
  <MenuItem>Profile</MenuItem>
  <MenuItem>Settings</MenuItem>
  <Separator className="my-2" />
  <MenuItem>Logout</MenuItem>
</div>

Accessibility

The Separator component is built on Base UI’s accessible Separator primitive, which:
  • Uses the appropriate ARIA separator role
  • Properly communicates orientation to assistive technologies
  • Follows WAI-ARIA best practices for separators
For more details, see the Base UI Separator documentation.

Build docs developers (and LLMs) love