Components
Back to catalog
Component detail entry
Layout
@vean/ui
SSeparator

Separator

Separator belongs to the Layout category. Start with demos and usage, then use the API tables to finish integration and styling decisions.

Use the quick jump panel to reach overview, usage, demos, and API first, then continue through the full page.

Quick jump

Related components

If you are composing interactions in the same family, these components usually pair well together.

Separator

Overview

The SSeparator component visually and semantically separates content sections. It renders a horizontal or vertical line, optionally with a label centered (or aligned) along it. Use it to divide related content blocks, group menu items, or structure form sections.

For layout-level spacing between sections, prefer the SCard or UnoCSS spacing utilities; use SSeparator when a visible dividing line aids comprehension.

Usage

Features

  • 📏 Orientation — Switch between horizontal and vertical layouts.
  • 🏷️ Label support — Render text or custom content inside the separator via the label prop or default slot.
  • ↔️ Alignment — Position the label at start, center, or end.
  • 〰️ Border styles — Choose solid, dashed, or dotted line styles.
  • 📐 Size scaling — Six sizes (xs–2xl) control label typography and spacing.
  • ♿ Accessibility — role="separator" with aria-orientation; decorative prop removes the element from the accessibility tree for purely visual dividers.
  • 🎨 Per-slot overrides — ui prop and class allow fine-grained styling of root and label slots.
  • 🌐 RTL aware — Label positioning and translation automatically adjust for right-to-left layouts.

Demos

Basic

Radix Primitives

An open-source UI component library.

Blog
Docs
Source

API

Aria Layer

4

Separator

9 Props
Props
PropTypeDefaultDescription
class
ClassValue
—
Additional class names applied to the root element.
size
ThemeSize
—
Visual size of the component.
ui
Partial<SeparatorUi>
—
Per-slot class overrides for the component.
align
Align
—
Align.
border
SeparatorBorder
—
Border.
label
string
—
Label text rendered by the component.
labelProps
SeparatorLabelProps
—
Properties forwarded to the label element.
orientation
DataOrientation
—
Orientation of the component. Either `vertical` or `horizontal`. Defaults to `horizontal`.
decorative
boolean
—
Whether or not the component is purely decorative. <br>When `true`, accessibility-related attributes are updated so that that the rendered element is removed from the accessibility tree.

SeparatorCompact

4 Props1 Slots
Props
PropTypeDefaultDescription
label
string
—
Label text rendered by the component.
labelProps
SeparatorLabelProps
—
Properties forwarded to the label element.
orientation
DataOrientation
—
Orientation of the component. Either `vertical` or `horizontal`. Defaults to `horizontal`.
decorative
boolean
—
Whether or not the component is purely decorative. <br>When `true`, accessibility-related attributes are updated so that that the rendered element is removed from the accessibility tree.
Slots
Slot NameParametersDescription
label
—
Custom content for the label slot.

SeparatorLabel

SeparatorRoot

2 Props
Props
PropTypeDefaultDescription
orientation
DataOrientation
—
Orientation of the component. Either `vertical` or `horizontal`. Defaults to `horizontal`.
decorative
boolean
—
Whether or not the component is purely decorative. <br>When `true`, accessibility-related attributes are updated so that that the rendered element is removed from the accessibility tree.

Notes

Architecture and benchmark differences

VeanUI splits Separator into an Aria layer (@vean/aria/separator) that owns SeparatorRoot (role/aria/orientation), SeparatorLabel, and SeparatorCompact (composition + label visibility logic), and a styled layer (@vean/ui) that owns the scv() variant recipe (size/orientation/align/border) and class injection via provideSeparatorUi. This follows the shadcn/ui headless/styled separation.

AspectVeanUIAnt Design DividerElement Plus ElDividerMUI DividerMantine Dividershadcn/ui Separator
ArchitectureAria + styled split, SeparatorUiSlot (root/label) + Compact aggregationsingle componentsingle componentsingle componentsingle componentAria + styled
Labellabel prop + default slot; align (start/center/end)orientation propcontent-position—labelPosition—
Border styleborder (solid/dashed/dotted)dashed propborder-style prop—variant—
Size scalingsize (xs–2xl) controls label typography + spacing———size—
Decorativedecorative → role="none"————decorative
RTLrtl:translate-x + logical start-* positioning—————

Runtime cautions

  • Vertical separators: labels are intentionally hidden when orientation="vertical" because the label cannot be meaningfully positioned along a vertical line. If you need a label next to a vertical separator, place it outside the component.
  • Decorative mode: when decorative is true, the element receives role="none" and aria-orientation is omitted so it is removed from the accessibility tree. Use this for purely visual dividers that screen readers should skip.
  • Full width / height: horizontal separators default to w-full and vertical separators to h-full. Wrap vertical separators in a flex container with a fixed height for correct rendering.

FAQ

When should I use decorative? Set decorative when the separator is purely visual and does not represent a semantic content boundary. This sets role="none", hiding it from screen readers. For content section dividers that convey meaning, leave decorative unset (defaults to role="separator").

Why is my label not showing on a vertical separator? Labels are intentionally suppressed for vertical orientations. Use a horizontal separator for labeled dividers, or place the label text outside the component.

How do I customize the label element’s attributes? Pass labelProps — it is forwarded directly to the SeparatorLabel element. For class overrides, use the ui.label slot instead.

How do I make the separator full-width? Horizontal separators are w-full by default. For vertical separators, ensure the parent container has a defined height; the separator uses h-full.

Changelog

Version history is grouped by release so you can quickly see what changed for this component across published versions.

v0.19.0

2026-05-11

Compare release

Feature

Implement SeparatorCompact

Scope: separatorAuthors: soybeanjs, CopilotKitView commit8ff3d

Fix

enhance slot handling and import consistency

Scope: separatorAuthors: soybeanfeView commit2518f

v0.0.2

2025-11-18

Compare release

Feature

add Separator component with customizable orientation and decorative options

Scope: separatorAuthors: soybeanjsView commit753e3

Refactor

replace divider component with separator component and update related imports

Scope: separatorAuthors: soybeanjsView commit0f034

Feature

add Separator component with customizable orientation and decorative options

Scope: separatorAuthors: soybeanjsView commit753e3

Refactor

replace divider component with separator component and update related imports

Scope: separatorAuthors: soybeanjsView commit0f034