Separator
Visually or semantically separates content. Perfect for dividing sections, creating navigation breadcrumbs, or organizing layouts in React applications with Next.js and TypeScript.
Those thin lines that split up your content? That's what separators do. They're like the periods of UI design - simple, essential, and you don't notice them until they're missing. Whether you're building breadcrumbs, dividing form sections, or just need some visual breathing room, separators keep things organized.
Basic usage
Clean horizontal and vertical lines:
Built on Radix UI Separator with proper ARIA semantics. This free open source React component handles both decorative and semantic separation, making your layouts cleaner and more accessible.
npx shadcn@latest add separator
Why separators matter
Good separators are invisible until you need them:
- Visual hierarchy - Break up dense content into digestible chunks
- Navigation clarity - Perfect for breadcrumbs and menu items
- Section divisions - Organize forms, settings, and content areas
- Flexible orientation - Horizontal lines and vertical dividers
- Semantic markup - Screen readers understand the content structure
- Zero bloat - Just a line, styled exactly how you want
Perfect for content organization
Works great anywhere you need visual separation - forms, dashboards, navigation, content areas. The kind of subtle UI element that makes interfaces feel polished and organized.
Drops right into Next.js projects. Full TypeScript support. Styled with Tailwind CSS to match the shadcn design system.
Built on Radix UI
Uses Radix UI Separator under the hood, which handles the accessibility:
- Semantic roles - Screen readers understand content structure
- ARIA compliance - Follows separator role requirements
- Decorative mode - For purely visual separators
- Flexible markup - Works as hr element or div with role
- RTL support - Works with any text direction
API Reference
Separator
The separator line element.
Prop | Type | Default | Description |
---|---|---|---|
className | string | - | Additional CSS classes |
orientation | "horizontal" | "vertical" | "horizontal" | Direction of the separator |
decorative | boolean | true | Whether separator is purely decorative |
Data attributes:
[data-orientation]
: "horizontal" | "vertical"
Orientation Options
Value | Use Case | Implementation |
---|---|---|
horizontal | Section breaks, content dividers | Default full-width line |
vertical | Navigation, inline separation | Fixed height line |
Common Patterns
Pattern | Use Case | Implementation |
---|---|---|
Content divider | Between sections | Horizontal separator with margin |
Navigation breadcrumb | Path indicators | Vertical separators between links |
Text overlay | "Or continue with" style | Separator with centered text |
Menu items | Inline navigation | Vertical separators between buttons |
Form sections | Group related fields | Horizontal with section labels |
Design tips for better separators
Keep these in mind when using separators:
- Don't overuse - Too many lines create visual clutter
- Match the context - Subtle for content, more prominent for navigation
- Consider spacing - Margin around separators creates breathing room
- Test contrast - Should be visible but not distracting
- Group logically - Separate related content, not random elements
- Vertical spacing - Horizontal separators need top/bottom margin
- Text overlays - Background color prevents line showing through text
Select
Displays a list of options for the user to pick from—triggered by a button. Built for React applications with Next.js integration and TypeScript support.
Sheet
Extends the Dialog component to display content that complements the main content of the screen. Perfect for sidebars, forms, and secondary content in React applications with Next.js and TypeScript.