WlBreadcrumbs
Appearance
Full example
<div class="wl-stack" data-space="md">
<WlBreadcrumbs
:items="items"
:max-items="3"
separator="›"
>
<template #item="{ item }"><span>{{ item.label }}</span></template>
</WlBreadcrumbs>
</div>Full and short paths
Parent page links, icon, current page without navigation and a single-level path.
Parent items are links. The last item receives aria-current="page" and does not navigate.
Full example
<script setup lang="ts">
import { WlBreadcrumbs, WlCheckbox } from "legato-ui";
import { ref } from "vue";
const short = ref(false);
</script>
<template>
<div class="wl-stack" data-space="lg">
<WlCheckbox v-model="short">{{ "Short path" }}</WlCheckbox>
<WlBreadcrumbs
:items="short
? [{ label: 'Legato UI', href: '?', icon: 'home' }, { label: 'Materials' }]
: [
{ label: 'Legato UI', href: '?', icon: 'home' },
{ label: 'Documentation', href: '?view=docs' },
{ label: 'Materials' }
]"
:pt="{ root: { 'aria-label': 'Path to materials' } }"
/>
<WlBreadcrumbs
:items="[{ label: 'Current page without parents' }]"
:pt="{ root: { 'aria-label': 'Single-level path' } }"
/>
<p class="wl-text-small wl-text-muted">{{ "Parent items are links. The last item receives aria-current=\"page\" and does not navigate." }}</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 |
|---|---|---|---|
items | readonly WlBreadcrumbItem[] | [] | WlBreadcrumbItem[]: { label, to?, href?, icon? }. |
pt | WlPt< | Not set | Attributes of internal Legato UI elements. |
separator | string | "/" | Text displayed between breadcrumb items. |
maxItems | number | Not set | Maximum visible breadcrumb items before collapsing the middle items. |
collapseLabel | string | Not set | Accessible name for the collapsed-items trigger. |
Events
No public events.
Slots
| Slot | Type / values | Content |
|---|---|---|
item | item?(props: { item: WlBreadcrumbItem; index: number; current: boolean }): unknown; | Custom breadcrumb item; receives the item, index and navigation state. |
separator | separator?(props: { item: WlBreadcrumbItem; index: number }): unknown; | Custom breadcrumb separator content. |
Pass-through: pt
Sections WlBreadcrumbs 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 | nav.wl-breadcrumbs | The root section in WlConfig.pt.breadcrumbs configuration. |
list | ol.wl-breadcrumbs__list | The list section in WlConfig.pt.breadcrumbs configuration. |
item | li.wl-breadcrumbs__item | The item section in WlConfig.pt.breadcrumbs configuration. |
collapseButton | button.wl-breadcrumbs__collapse | Button that expands collapsed breadcrumb items. |
separator | span.wl-breadcrumbs__sep | The separator section in WlConfig.pt.breadcrumbs 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
- Intermediate items get real href/to values; the last item remains text with aria-current=page.
- The icon supports link text. Separators are hidden from assistive technology.
- If the page has multiple paths, give them different names through pt.root aria-label; preserve the parent hierarchy on mobile too.
Keyboard and application responsibilities
| Key | Action |
|---|---|
| Tab / Shift+Tab | Move between enabled links, actions and form controls. |
| Enter / Space | Activate native actions; links follow with Enter. |
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.