Separator

A line that divides content, across or down the page.

First

Second

Third

Usage

Code
import { Separator } from '@leverui/components';
Code
<Separator />

Examples

Variants

Use the variant prop to change the appearance of the separator.

Sizes

Use the size prop to change the size of the separator.

Label

Place text beside the Separator to add a label to the separator.

Label (start)

Label (end)

Label (center)

Vertical

Use the orientation prop to change the orientation of the separator.

First

Second

Responsive Orientation

Here's an example of how to change the orientation property based on the screen size.

When the orientation prop is a responsive value, the separator will be rendered without aria-orientation and the role is set to presentation.

First
Second

Guides

Renders a <span> with the separator role. The line uses the Lever UI border color.

When the direction changes at a breakpoint, the border on the old edge stays. Remove it in your own CSS to show only one line.

Set orientation on each vertical Separator. The ARIA orientation comes only from that prop. A provider default changes only how the line looks.

No label prop. Put text between two separators in a flex row. Remove one line to put the label at the start or the end.

Props

PropDefaultTypeDescription
variantsolid'solid' | 'dashed' | 'dotted' or responsive mapLine style.
orientationhorizontal'vertical' | 'horizontal' or responsive mapLine direction.
sizesm'xs' | 'sm' | 'md' | 'lg' or responsive mapLine thickness.
asspanNative HTML tagHTML tag to render.
asChild—Solid render functionRender your own element with the separator's props.
unstyledfalsebooleanTurn off the Lever UI styles.

Also accepts normal HTML attributes, ref, class, and style. SeparatorPropsProvider sets the default variant and unstyled value for the separators inside it. Defaults are reactive. A prop on a separator wins.

Customize with CSS

Import @leverui/components/styles.css before your own CSS. Your CSS can then target .leverui-separator without !important. Set --leverui-separator-color and --leverui-separator-thickness on one separator or on a theme wrapper.

Attributes: data-size, data-variant, data-orientation, and per-breakpoint forms such as data-size-md.