Divider
<wa-divider>
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 it's neighboring elements.
Orientation
The default orientation for dividers is horizontal. Set orientation attribute to vertical to draw a vertical divider. The divider will span the full height of its Flexbox or CSS Grid container.
If your container isn't Flexbox or CSS Grid, you may need to set an explicit height for the divider.
Dropdown Dividers
Use dividers in dropdowns to visually group dropdown items.
Importing
If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.
Import this component directly from the CDN:
import 'https://ka-f.webawesome.com/[email protected]/components/divider/divider.js';
After installing Web Awesome via npm, import this component:
import '@awesome.me/webawesome/dist/components/divider/divider.js';
If you're self-hosting Web Awesome, import this component from your server:
import './webawesome/dist/components/divider/divider.js';
To import this component for React 18 or below, use the following code:
import WaDivider from '@awesome.me/webawesome/dist/react/divider/index.js';
Attributes & Properties
Learn more about attributes and properties.
| Name | Description | Reflects | |
|---|---|---|---|
css |
One or more CSSResultGroup to include in the component's shadow root. Host styles are automatically prepended.
Type
CSSResultGroup | undefinedDefault
styles |
||
orientationorientation |
Sets the divider's orientation.
Type
'horizontal' | 'vertical'Default
'horizontal' |
|
CSS custom properties
Learn more about CSS custom properties.
| Name | Description |
|---|---|
--color |
The color of the divider.
|
--spacing |
The spacing of the divider.
|
--width |
The width of the divider.
|