WlDivider
Placement
Full example
<div class="wl-stack" data-space="md">
<div v-if="vertical" class="wl-inline" data-space="sm">
<span>{{ "Overview" }}</span>
<WlDivider />
<span>{{ "Additional details" }}</span>
</div>
<WlDivider v-else >{{ "Additional details" }}</WlDivider>
</div>Divider line and label
Plain divider, “or” text and custom default slot content between page sections.
A simple line separates independent sections of content.
Continue another way.
The default-slot label belongs to the divider; section headings are separate.
Full example
<script setup lang="ts">
import { WlButton, WlDivider } from "legato-ui";
import { ref } from "vue";
const selected = ref(false);
</script>
<template>
<div class="wl-stack" data-space="lg">
<p class="wl-text-body">{{ "A simple line separates independent sections of content." }}</p><WlDivider />
<div><WlButton variant="primary" @click="selected = true">{{ "Sign in by email" }}</WlButton></div>
<WlDivider>{{ "or" }}</WlDivider>
<p class="wl-text-body">{{ "Continue another way." }}</p>
<WlDivider><span class="wl-text-small wl-text-muted">{{ "Next section" }}</span></WlDivider>
<p v-if="selected" class="wl-text-small" role="status">{{ "Email sign-in selected in the local example." }}</p>
<p class="wl-text-small wl-text-muted">{{ "The default-slot label belongs to the divider; section headings are separate." }}</p>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
pt | WlPt< | Not set | Attributes of internal Legato UI elements. |
orientation | "horizontal" | | Not set | Layout direction and applicable arrow-key navigation direction. |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
default | — | Text or other content centred on the line. |
Pass-through: pt
Sections WlDivider are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | div | The root section in WlConfig.pt.divider configuration. |
content | span | The content section in WlConfig.pt.divider configuration. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- The divider uses role=separator; the default slot can add a short label.
- Do not use a divider in place of a section heading or interactive element.
- Check that its label is not the only explanation of an action and is readable in every theme.
Keyboard and application responsibilities
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.