<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 --width custom property to change the width of the divider.

Color

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

Spacing

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

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
--colorThe color of the divider.
--spacingThe spacing of the divider.
--widthThe width of the divider.