Divider
<wa-divider>
Dividers are used to visually separate or group elements.
<wa-divider></wa-divider>
Examples Jump to heading
Width Jump to heading
Use the --width
custom property to change the width of the divider.
<wa-divider style="--width: 4px;"></wa-divider>
Color Jump to heading
Use the --color
custom property to change the color of the divider.
<wa-divider style="--color: tomato;"></wa-divider>
Spacing Jump to heading
Use the --spacing
custom property to change the amount of space between the divider and it's neighboring elements.
<div style="text-align: center;"> Above <wa-divider style="--spacing: 2rem;"></wa-divider> Below </div>
Vertical Jump to heading
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.
<div style="display: flex; align-items: center; height: 2rem;"> First <wa-divider vertical></wa-divider> Middle <wa-divider vertical></wa-divider> Last </div>
Menu Dividers Jump to heading
Use dividers in menus to visually group menu items.
<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>
Attributes & Properties Jump to heading
Learn more about attributes and properties.
Name | Description | Reflects | |
---|---|---|---|
vertical vertical |
Draws the divider in a vertical orientation.
Type
boolean Default
false |
|
CSS custom properties Jump to heading
Learn more about CSS custom properties.
Name | Description |
---|---|
--color |
The color of the divider.
|
--width |
The width of the divider.
|
--spacing |
The spacing of the divider.
|
Importing Jump to heading
The autoloader is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
To manually import this component from the CDN, use the following code.
import 'https://early.webawesome.com/webawesome@3.0.0-alpha.12/dist/components/divider/divider.js';