Join our Discord Community

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:

Loading component...

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.

PropTypeDefaultDescription
classNamestring-Additional CSS classes
orientation"horizontal" | "vertical""horizontal"Direction of the separator
decorativebooleantrueWhether separator is purely decorative

Data attributes:

  • [data-orientation]: "horizontal" | "vertical"

Orientation Options

ValueUse CaseImplementation
horizontalSection breaks, content dividersDefault full-width line
verticalNavigation, inline separationFixed height line

Common Patterns

PatternUse CaseImplementation
Content dividerBetween sectionsHorizontal separator with margin
Navigation breadcrumbPath indicatorsVertical separators between links
Text overlay"Or continue with" styleSeparator with centered text
Menu itemsInline navigationVertical separators between buttons
Form sectionsGroup related fieldsHorizontal 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