Divider
The divider component is used as a separator between content.
<script type="module">import '@vonage/vivid/divider';</script>
<!-- Feel free to edit the code below. The live preview will update as you make changes. --> <vwc-divider></vwc-divider>
- Type:
'horizontal'
|'vertical'
- Default:
horizontal
<!-- Feel free to edit the code below. The live preview will update as you make changes. --> <vwc-divider orientation="horizontal"></vwc-divider> <vwc-divider orientation="vertical" style="block-size: 40px;"></vwc-divider>
A <vwc-divider>
element is by default rendered with a role of 'separator'
.
When using <vwc-divider>
as a decorative element the role should be set as 'presentation'
.
For further reading about divider foundational role & accessibility
<!-- Feel free to edit the code below. The live preview will update as you make changes. --> <vwc-action-group appearance="fieldset"> <vwc-button icon="transfer-line"></vwc-button> <vwc-divider orientation="vertical"></vwc-divider> <vwc-button icon="compose-line"></vwc-button> </vwc-action-group>
<!-- Feel free to edit the code below. The live preview will update as you make changes. --> <style> vwc-card { width: 400px; } .demo-footer { display: flex; column-gap: 8px; justify-content: flex-end; } </style> <vwc-card> <vwc-layout column-basis="block" gutters="small" slot="main"> Choose the button you like best in this card :) <vwc-divider></vwc-divider> <div class="demo-footer"> <vwc-button label="Cancel" appearance="outlined"></vwc-button> <vwc-button label="Submit" appearance="filled"></vwc-button> </div> </vwc-layout> </vwc-card>
<!-- Feel free to edit the code below. The live preview will update as you make changes. --> <style> vwc-layout { --layout-grid-template-columns: 1fr auto 1fr; } vwc-divider { display: flex; align-items: center; } </style> <vwc-layout> <vwc-divider role="presentation"></vwc-divider> More Info <vwc-divider role="presentation"></vwc-divider> </vwc-layout>