Separator
Visually or semantically separates content.
When to use
- Divide adjacent content without a box, in a row or in a column.
- Put a text label in the middle or at one end of a horizontal divider: wrap the label and the separators in a
HorizontalSeparatorGroup. - Prefer
Cardwhen the content needs a border on every side. - Prefer
Wellwhen the content needs a recessed background, not a line. - Prefer
DescriptionListwhen the content is key and value pairs, which carry their own rows.
Vertical
Set orientation="vertical" to divide items in a row. The parent sets the height.
Semantic
A separator is decorative by default, and assistive technology skips it. Set semantic when the line marks a real boundary between two groups of content: it renders role="separator".
Labeled divider
Wrap a label and one or two separators in a HorizontalSeparatorGroup to put the label in the middle or at one end of the line.
Polymorphism
To render something else as a HorizontalSeparatorGroup or Separator, use the asChild prop to compose.
Color
The separator renders in the semantic separator color token: gray-500/20 in light and gray-600/20 in dark.
This is the canonical divider color across mantle: Accordion dividers,
DropdownMenu.Separator, Command.Separator, Select.Separator, and the rest all resolve to it.
Reuse the same color on your own dividers instead of hard-coding it:
API Reference
Separator
Visually or semantically separates content.
All props from div, plus:
HorizontalSeparatorGroup
A container to layout a group of horizontal separators and other children.
Overrides all children Separators to be orientation="horizontal".
All props from div, plus: