Skip to content

Separator and Divider for React

A React separator for hairline dividers, horizontal or vertical, solid, fading or dashed, with an optional label. Use it as a React divider between groups in a settings page, such as Account and Notifications, where a fading or solid hairline gives the page rhythm without adding another card.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/separator.json

Variants and orientation

Vertical separators stretch to the height of their row.

variant="line"
variant="fade"
variant="dashed"

Files to copy

3 folders · 1 file · 4 packages
From theme/src/
  • components/separator/
  • lib/cn.ts
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/separator.jsonRegistry item: separator. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/button/
  • components/input/
  • components/spinner/
  • hooks/{use-latest.ts, use-magnetic.ts, use-media-query.ts, use-preferences.ts}
  • motion/{gate.ts, tokens.ts}
  • lib/{field-size.ts, form.ts, state-light.tsx}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/button.json https://lokendra-builds.github.io/sheenui/r/input.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Labeled

A label in the middle (“or”), in a glass pill, or at the start of the line. Screen readers hear the label as the separator's name.

Three new messages from the design team.

Experimental options live below this line.

Separator

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal"Direction of the line. Vertical separators stretch to the height of their row.
variant"line" | "fade" | "dashed""line""line" hairline (default), "fade" softens toward the ends, "dashed" for looser groupings.
labelReactNodeNoneText or node in the middle of the line, e.g. "or", "Today".
labelAlign"center" | "end" | "start""center"Where the label sits along the line.
labelVariant"text" | "pill""text""text" (default) or "pill": the label sits in a small glass chip.
decorativebooleanfalsePurely visual: hidden from assistive tech (no role="separator").
classNamestringNoneExtra classes for the outer element, merged after the built-in ones so they can override its spacing or color.
labelClassNamestringNoneAdds a class name to the label element.

Keyboard

KeysAction
TabNot focusable: a separator is not interactive.

Accessibility

  • role="separator" with the matching orientation; a separator with a label keeps its text readable and its children are presentational to assistive tech.
  • Use a decorative separator only to group visually; it does not replace headings or landmarks.

When to use Separator

  • Use it to split a toolbar into clusters with a vertical hairline, or to divide Account from Notifications settings with a fading rule and a centered label, instead of nesting another card.
  • Use a labeled separator with the word or between a password form and social sign-in buttons, with labelVariant="pill" when the label should sit in a small glass chip.
  • Use orientation="vertical" between items in a row, such as a toolbar of stats or a footer's links, where the line stretches to the height of its row.
  • Skip it when the break is structural and a screen reader user should find it; use a real heading or landmark, because a decorative separator does not replace either.
  • Pair it with GlassCard to divide its sections, Toolbar, which has its own ToolbarSeparator for control groups, and Menu for dividing action groups in a dropdown.

Frequently asked questions

67 components pages in all: browse them on All components.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .