☀️ Summer Sale: up to 40% off all templates for a limited time.Get the deal
Shadcnadmin.com

Search

Search dashboards, components and blocks

Shadcn Separator Components

Visually or semantically separates content. All separator styles apply cleanly in Radix UI and Base UI layouts. Built with Shadcn UI, Tailwind CSS, Next.js and React, compatible with both Radix UI and Base UI primitives. Typescript included.

Separator 1

Separator 2

Separator 3

Separator 4

Separator 5

Separator 6

Separator 7

Separator 8

Separator 9

Icon + Horizontal

Icon + Vertical

Gradient border + Vertical

Gradient border + Horizontal

Separator 14

Gradient border

Separator 16

Shadcn Separator: Dividers for React Layouts

The shadcn separator visually or semantically divides content, rendering the humble horizontal rule as a themeable, accessible react divider component. Styled with Tailwind CSS, it supports horizontal and vertical orientations and decides for you when a divider should be announced to assistive technology and when it is purely decorative.

Sixteen separator examples live on this page, which is more range than most people expect from a divider. Beyond plain lines you will find separators with centered text, icon separators in horizontal and vertical orientations, gradient border treatments in both directions, dashed and dotted styles, and spacing variations, all as copy-paste TypeScript snippets for Next.js projects.

What you get

  • Both orientations: Horizontal rules for stacked content and vertical dividers for toolbars and inline metadata.
  • Text separators: Lines with centered labels, the classic or continue with pattern on auth screens.
  • Icon separators: Horizontal and vertical variants that place an icon at the midpoint of the line.
  • Gradient borders: Fading gradient treatments in both orientations for softer section breaks.
  • Style variations: Dashed, dotted, thick, and inset options so dividers can signal different levels of separation.

Implementation tips

  • Give vertical separators height: A vertical divider needs a parent with a defined height or stretch alignment in flex layouts, otherwise it collapses invisibly.
  • Use decorative mode by default: Most dividers are visual polish. Keep the decorative prop on so screen readers skip them, and remove it only for true thematic breaks.
  • Prefer gap over separators: Whitespace often divides content more cleanly than a line. Reach for a separator when proximity alone is ambiguous.
  • Build text separators with flex: Two flex-1 lines around a label is simpler and more robust than absolutely positioning text over a single rule.
  • Match the muted palette: Dividers should use border or muted tokens, since high contrast lines fragment a layout instead of organizing it.

Where it fits in a dashboard

Separators do quiet structural work everywhere in an admin interface: between sections of a settings page, between a card header and its content, between groups in a dropdown menu, and between inline stats in a toolbar where vertical dividers keep counts readable.

The decorated variants have specific homes. Text separators split OAuth buttons from credential forms on login screens, and gradient separators soften section breaks on marketing style overview pages where a hard line would feel heavy.

Related components and patterns

Separators most often appear inside other components: dividing a Card into regions, splitting groups in a Dropdown Menu, or separating rows in an Item list. Vertical dividers commonly sit between actions in a Button Group or alongside a Breadcrumb trail in a page header.

When you find yourself separating collapsible sections repeatedly, an Accordion may express the structure better than lines alone.

Library support

The component tracks the shadcn/ui Separator docs and builds on the Radix UI Separator primitive, which handles the separator role, orientation attributes, and the decorative escape hatch.

Base UI provides an equivalent Separator component for projects on that stack, and since the visual layer here is plain Tailwind CSS, every variant on this page transfers between the two with no styling changes.

FAQs

What does the decorative prop on a separator do?
When decorative is true the element is hidden from assistive technology, which suits purely visual dividers. Without it, the separator role and orientation are exposed to screen readers as a semantic break.
Which primitive powers the shadcn separator?
It wraps the Radix UI Separator primitive, and Base UI offers an equivalent Separator component, so the same styled variants work in projects standardized on either library.
Why is my vertical separator not showing up?
Vertical separators collapse when the parent has no height. Put the divider in a flex container with items-stretch or give it an explicit height like h-4 for inline metadata rows.
How do I make a separator with text in the middle?
Use a flex row with a line on each side of the label, each taking flex-1. The text separator variants on this page implement this pattern ready to copy.
Should I use a separator or just spacing between sections?
Start with spacing, since generous gaps often communicate grouping on their own. Add separators where content is dense or where two adjacent groups could be misread as one.