Overview
Separator renders a div with role="separator" and an accessible orientation. It uses the Base UI separator contract, including native props, refs, and render composition. Import SeparatorProps from the same entry point.
Usage
Orientation and appearance
orientation defaults to horizontal. Margins default to zero in both orientations. Horizontal separators fill the available width. Vertical separators stretch along their flex container. Give a standalone vertical separator a height. Control spacing through the parent layout, or use native style or className for explicit margins and line color. Base UI also accepts functions of the orientation for these props.
Labeled dividers
Use LabeledSeparator for a text label between divider lines or at the end of a rule. It provides the layout and a single accessible separator name.Migration
Replace the former horizontal helper withSeparator. Remove noMargin, since margins now default to zero. To keep the former default spacing, add style={{ marginBlock: 'var(--t-spacing-3)' }}. Replace color with style={{ backgroundColor: color }}. Use LabeledSeparator for labeled dividers, pass the label as children, and rename textPosition to labelPosition. Replace separators used only for invisible spacing with layout spacing.
Props
CSS class or function of the separator orientation.