WlBreadcrumbs

Breadcrumbs: path to the current page. The last item has no link.
Components / Navigation v0.1.0

Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.

Settings

separator

Text displayed between breadcrumb items.

maxItems

Maximum visible breadcrumb items before collapsing the middle items.

collapseLabel

Accessible name for the collapsed-items trigger.

Props items, pt, models, handlers and slots can be edited in the SFC. See their descriptions in API.

Example

Focus: outside the example · pointer: outside the example

Explore the live example and copy its Vue SFC into your application. Settings on the left can be combined.

Code for your application

Vue SFC · current settings
<script setup lang="ts">
import { WlBreadcrumbs } from "legato-ui";
import { computed } from "vue";
const items = computed(() => [
  { key: "home", label: "Legato UI", href: "#ds-components" },
  { key: "docs", label: "Documentation", href: "#ds-components" },
  { key: "materials", label: "Materials", href: "#ds-components" },
  { key: "design", label: "Design", href: "#ds-components" },
  { key: "guide", label: "Team guide" }
]);
</script>

<template>
  <div class="wl-stack" data-space="md">
    <WlBreadcrumbs
      :items="items"
      :max-items="3"
      separator="›"
      
    >
      <template #item="{ item }"><span>{{ item.label }}</span></template>
    </WlBreadcrumbs>
  </div>
</template>

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.

Vue SFC · additional 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>