<cs-divider>
StableLayoutSince 0.1

Dividers visually separate or group adjacent elements with a horizontal or vertical line. Use them to establish rhythm and hierarchy within menus, toolbars, and layouts.

Examples

Width

Use the --cs-divider-width custom property to change the width of the divider.

Color

Use the --cs-divider-color custom property to change the color of the divider.

Spacing

Use the --cs-divider-spacing custom property to change the amount of space between the divider and its neighboring elements.

Above Below

As a direct child of a layout utility such as cs-stack or cs-cluster, --cs-divider-spacing has no effect and the container’s gap sets the space instead. These utilities set the margins of their children to zero, the divider included, so the gap is the only space between items. Add a cs-gap-* class to the container to change it.

Above Below

Orientation

The default orientation for dividers is horizontal. Set the orientation attribute to vertical to draw a vertical divider. The divider will span the full height of its Flexbox or CSS Grid container.

First Middle Last

If your container isn’t Flexbox or CSS Grid, you may need to set an explicit height for the divider.

Use dividers in dropdowns to visually group dropdown items.

Menu Option 1 Option 2 Option 3 Option 4 Option 5 Option 6

API

Importing

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick this component, use one of the following snippets.

npm Self-Hosted React
import '@cruglobal/cornerstone-components/components/divider/divider.js';
import './cornerstone/components/divider/divider.js';
import CsDivider from '@cruglobal/cornerstone-components/react/divider/index.js';

Attributes & Properties

Learn more about attributes and properties.

PropertyAttributeDescriptionTypeDefaultReflects
orientationorientationSets the divider's orientation.'horizontal' | 'vertical''horizontal'Yes

CSS Custom Properties

Learn more about CSS custom properties.

NameDescriptionDefault
--cs-divider-colorThe color of the divider.var(--cs-color-surface-border)
--cs-divider-spacingThe margin on either side of the divider: above and below it when horizontal, left and right when vertical. As a direct child of a layout utility such as cs-stack or cs-cluster, the container's gap sets this space instead, so use a cs-gap-* class on the container to change it.var(--cs-space-m)
--cs-divider-widthThe width of the divider.var(--cs-border-width-s)