Skip to content

Separator

A static line that divides content or action groups.

Retrieval

Top K 4, score threshold 0.5

Rerank model

Cohere rerank-multilingual-v3.0

hero.tsx

Usage guidelines

  • Separate meaningful groups: By default Separator exposes role="separator" and its orientation, for a boundary between content or action groups.
  • Mark ornaments decorative: Set decorative on a purely visual line, such as a title ornament or a skeleton line. It renders role="none" and exposes no orientation.
  • Keep labels outside the line: Descendants of role="separator" are presentational, so headings and labels sit beside the separator, not inside it.
  • Use the menu's own separator inside menus: A menu, select or combobox popup uses the separator part of its own family.
  • Do not build a resize handle from it: Separator stays out of the tab order and has no value or keyboard interaction. It needs no accessible name.
  • Own spacing and length in the layout: The line is 1px thick with no margins. Width sets the length of a horizontal line, height sets the length of a vertical one, and margins come from className or the parent's gap.
  • Change color through tokens: Use a background token for a solid line and a gradient-start token for a gradient line. Use variant="gradient" instead of repeating the gradient classes.

Anatomy

tsx
tsx

Examples

Vertical

Set orientation="vertical" and give the line a height. Here it divides editing tools from publishing actions in a toolbar.

vertical.tsx

Decorative gradient

variant="gradient" fades from left to right. The direction is physical, so the line fades toward the right in a right-to-left layout too. Beside a section title the line is an ornament, so it is decorative.

Variables
decorative-gradient.tsx

API reference

Separator

A horizontal or vertical divider between content groups. Renders a <div> element.

Base UI Separator docs

Props
PropTypeDefaultDetails
decorativebooleanfalse
variant'gradient' | 'solid''solid'
Base UI Separator docs
Data attributes
AttributeDescription
data-orientation

Values: 'horizontal' | 'vertical'

Indicates the orientation of the separator.