<wa-divider>
Dividers are used to visually separate or group elements.
<wa-divider></wa-divider>
Use the --width
custom property to change the width of the divider.
<wa-divider style="--width: 4px;"></wa-divider>
Use the --color
custom property to change the color of the divider.
<wa-divider style="--color: tomato;"></wa-divider>
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>
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>
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>
Name | Description | Reflects | |
---|---|---|---|
vertical vertical
|
Draws the divider in a vertical orientation.
Type
boolean
Default
false
|
|
Name | Description |
---|---|
--color |
The color of the divider.
|
--width |
The width of the divider.
|
--spacing |
The spacing of the divider.
|
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.4/dist/components/divider/divider.js';