3.0.0-alpha.4 Alpha
Light Dark Light Dark System Search /

Divider

<wa-divider> Since 2.0 stable

Dividers are used to visually separate or group elements.

<wa-divider></wa-divider>

Examples

Width

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

<wa-divider style="--width: 4px;"></wa-divider>

Color

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

<wa-divider style="--color: tomato;"></wa-divider>

Spacing

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

Above Below
<div style="text-align: center;">
  Above
  <wa-divider style="--spacing: 2rem;"></wa-divider>
  Below
</div>

Vertical

Add the vertical attribute to draw the divider in a vertical orientation. The divider will span the full height of its container. Vertical dividers work especially well inside of a flex container.

First Middle Last
<div style="display: flex; align-items: center; height: 2rem;">
  First
  <wa-divider vertical></wa-divider>
  Middle
  <wa-divider vertical></wa-divider>
  Last
</div>

Use dividers in menus to visually group menu items.

Option 1 Option 2 Option 3 Option 4 Option 5 Option 6
<wa-menu style="max-width: 200px;">
  <wa-menu-item value="1">Option 1</wa-menu-item>
  <wa-menu-item value="2">Option 2</wa-menu-item>
  <wa-menu-item value="3">Option 3</wa-menu-item>
  <wa-divider></wa-divider>
  <wa-menu-item value="4">Option 4</wa-menu-item>
  <wa-menu-item value="5">Option 5</wa-menu-item>
  <wa-menu-item value="6">Option 6</wa-menu-item>
</wa-menu>

Properties

Name Description Reflects
vertical
vertical
Draws the divider in a vertical orientation.
Type boolean
Default false

CSS custom properties

Name Description
--color
The color of the divider.
--width
The width of the divider.
--spacing
The spacing of the divider.

Importing

The autoloader is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.

CDN npm React

To manually import this component from the CDN, use the following code.

import 'https://early.webawesome.com/webawesome@3.0.0-alpha.4/dist/components/divider/divider.js';
Coming soon! Coming soon!
    No results