Unified UI

Separator

A visual divider between content sections with horizontal/vertical orientation, label support, and multiple style variants.

Basic

A visual separator line used to divide content into distinct sections. Built on Radix UI's Separator primitive with design system tokens.

Content above

Content below

Installation

Install the component via the CLI in one command.

npx @work-rjkashyap/unified-ui add separator
pnpm dlx @work-rjkashyap/unified-ui add separator
npx @work-rjkashyap/unified-ui add separator
bunx @work-rjkashyap/unified-ui add separator

If you haven't initialized your project yet, run npx @work-rjkashyap/unified-ui init first. See the CLI docs for details.

Or install the full package

Use this approach if you prefer to install the entire design system as a dependency instead of copying individual components.

npm install @work-rjkashyap/unified-ui
pnpm add @work-rjkashyap/unified-ui
yarn add @work-rjkashyap/unified-ui
bun add @work-rjkashyap/unified-ui

Anatomy

import { Separator } from "@work-rjkashyap/unified-ui";

Examples

Horizontal (default)

The default orientation is horizontal — a full-width line with vertical margin.

Section One
Section Two
Section Three

Vertical

Use orientation="vertical" for inline dividers — for example, between toolbar items or navigation links. The parent must have a defined height (e.g. flex with items-center).

Home
Blog
About

Variants

Four visual variants to match different contexts.

Default
Muted
Dashed
Gradient
VariantDescription
defaultSolid line using the border token color.
mutedLighter line at reduced opacity.
dashedDashed border style for a softer division.
gradientFades from transparent at edges through the center.

Spacing

Control the margin around the separator using the spacing prop with the Tailwind spacing scale.

spacing=0
spacing=2
spacing=4 (default)
spacing=8
spacing=12
End
SpacingHorizontal MarginVertical Margin
0my-0mx-0
1my-1mx-1
2my-2mx-2
3my-3mx-3
4my-4 (default)mx-4
5my-5mx-5
6my-6mx-6
8my-8mx-8
10my-10mx-10
12my-12mx-12

With Label

Pass a label prop to render centered text on the separator — useful for "or" dividers, section breaks, and form layouts. Labels are only supported with horizontal orientation.

OR
Continue with
Section Break

Labeled with Gradient

OR

Real-World Examples

Settings Section Divider

AccountManage your account settings and preferences.
NotificationsChoose what notifications you want to receive.
PrivacyControl who can see your information.

Login Form Divider

Sign in with Google
OR
Email & Password

Toolbar Divider

Bold
Italic
Underline
Left
Center
Right

Props

PropTypeDefaultDescription
variant"default" | "muted" | "dashed" | "gradient""default"Visual style of the separator line.
orientation"horizontal" | "vertical""horizontal"Direction of the separator.
decorativebooleantrueWhen true, hidden from assistive technology. When false, renders as a semantic separator.
spacing0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 124Margin around the separator (vertical for horizontal, horizontal for vertical).
labelReactNodeOptional centered label text. Only supported for horizontal orientation.
classNamestringAdditional CSS classes.

All standard HTML attributes are forwarded to the underlying Radix UI Separator.Root element.


Accessibility

Most separators are purely decorative. Only set decorative={false} when the separator conveys meaningful structure (e.g., separating form sections that a screen reader should announce).

  • decorative={true} (default) — Renders with role="none", completely hidden from assistive technology. Use this for visual-only dividers.
  • decorative={false} — Renders with role="separator" and aria-orientation, making it visible to screen readers as a structural boundary.
  • Label text — When a label is provided, the text is visible but does not affect semantics when decorative is true. For non-decorative labeled separators, the wrapper receives the separator role.

Separator vs. Divider

The design system includes both a Separator component (in the components layer) and a Divider primitive (in the primitives layer):

FeatureSeparatorDivider
LayerComponentsPrimitives
Built onRadix UI SeparatorNative <hr> element
Variantsdefault, muted, dashed, gradientNone
Labels✅ Supported❌ Not supported
Decorative✅ Radix-managed roleRelies on aria-orientation
Use caseRich dividers with labels and variantsSimple spacing lines

Use Separator when you need variant styling, labels, or Radix-level accessibility semantics. Use Divider for simple, lightweight spacing lines in layout primitives.


Design Tokens

TokenUsage
--borderDefault separator line color
--muted-foregroundMuted variant and label text color

On this page