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
Separatorexposesrole="separator"and its orientation, for a boundary between content or action groups. - Mark ornaments decorative: Set
decorativeon a purely visual line, such as a title ornament or a skeleton line. It rendersrole="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:
Separatorstays 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
classNameor 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.
| Prop | Type | Default | Details |
|---|---|---|---|
decorative | boolean | false | |
variant | 'gradient' | 'solid' | 'solid' | |
orientation | 'horizontal' | 'vertical' | 'horizontal' | |
className | string | ((state: SeparatorState) => string | undefined) | No default | |
render | ComponentRenderFn<HTMLProps, SeparatorState> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | No default | |
style | React.CSSProperties | ((state: SeparatorState) => React.CSSProperties | undefined) | No default | |
| Attribute | Description |
|---|---|
data-orientation | Values: Indicates the orientation of the separator. |