Skip to content
Component installs need the registry setup
VegaStack Design

Separator

A one-pixel rule that visually or semantically separates content, in either orientation, built on Base UI.

Status
stable
Since
0.1.0
Accessibility pattern
decorative by default

Last updated

VegaStack Design
The foundation for your design system
A set of components you can copy into your project, customize, extend and build on.

Install

Configure registry credentials first using the Quickstart. Before copying this item or any transitive registry dependency, verify the signed manifest and save the exact bytes for Separator before installation. Retain the digest printed by this command.

pnpm exec vegastack-design verify separator

Install with the pinned shadcn CLI. Bare shadcn does not verify VegaStack signature or integrity.

pnpm dlx shadcn@4.21.0 add @vegastack/separator

Run the exact offline --post-write command printed by the preflight, using its saved item path and independently retained --expected-integrity digest. Use the saved preflight for every transitive registry dependency too; stop on any mismatch before using the components.

Usage

import { Separator } from "@/components/ui/separator";

<Separator />;
VegaStack Design
The foundation for your design system
A set of components you can copy into your project, customize, extend and build on.

Examples

Vertical

Use orientation="vertical" for a vertical separator. It stretches to the height of its flex row, so the row — not the separator — sets the length.

Blog
Docs
Source

Vertical separators between menu entries with descriptions.

SettingsManage preferences
AccountProfile and security

List

Horizontal separators between list rows.

Item 1
Value 1
Item 2
Value 2
Item 3
Value 3

RTL

A horizontal separator spans the full inline size, so a right-to-left document needs no change.

VegaStack Design
The foundation for your design system
فيغاستاك ديزاين
الأساس لنظام التصميم الخاص بك

API Reference

Separator adds no props of its own — it accepts everything the underlying element or Base UI primitive accepts (className, ref, ARIA attributes, event handlers).

Accessibility

  • Base UI's Separator renders role="separator" with aria-orientation, so assistive technology announces the division rather than inferring it from a border.
  • It is never focusable and never a control: a separator that also does something is a button or a resize handle, not this component.
  • A separator that merely decorates a layout should be hidden from assistive technology with aria-hidden on the element that owns the decoration, so the rule is not announced twice.
  • Colour alone never carries the meaning of a division — the content on each side must stand on its own.
ContractStates tested
Behaviourdefault
Accessibilitynative-or-base-ui-semantics, browser-accessibility-test
Visualdefault

Do / Don't

Do
Let a flex row size a vertical separator, which stretches to the row's own height.
Don't
Add a border to the neighbouring element instead — the division then has no accessible role.

Deviations

Upstream's file plus packages/ui/upstream/patches/separator.patch. Every hunk:

  • DOC-2 — cn is imported from @vegastack/design, and the file carries the registry provenance header. Nothing else differs from vendor/shadcn/4.21.0/ui/separator.tsx.

On this page