Breadcrumbs

Alignment target:@astryxdesign/core v0.7.1 · Breadcrumbs

Usage #

Import Breadcrumbs and BreadcrumbItem from their dedicated entry.

Vue
<script setup lang="ts">
import { BreadcrumbItem, Breadcrumbs } from '@astryx-vue/core/Breadcrumbs'
</script>

<template>
  <Breadcrumbs>
    <BreadcrumbItem href="/">
      Home
    </BreadcrumbItem>
    <BreadcrumbItem href="/components">
      Components
    </BreadcrumbItem>
    <BreadcrumbItem is-current>
      Breadcrumbs
    </BreadcrumbItem>
  </Breadcrumbs>
</template>

A crumb in the middle of the trail can open a menu for sibling destinations. A short list is a menu array. Checkbox and radio rows go in the menu slot on that crumb, and the slot replaces the array. Those rows are exported from the breadcrumbs entry and are the same components the menu uses, so a choice opens and closes the same way.

Anatomy

ElementDescription
TrailThe ordered list of links from root to current page.
ItemA single step in the trail. Renders as a link or plain text for the current page.
SeparatorThe character between items. Defaults to "/" but can be customized.
IconAn optional icon before an item label, like a home icon on the first item.

Best practices #

GuidancePractice
RecommendedUse semantic <nav> and <ol> markup so screen readers can identify the path.
RecommendedUse is-current for the current page and render it as a <span> with aria-current="page".
RecommendedKeep separators decorative with aria-hidden="true".
Don'tUse overly long labels that wrap awkwardly on small screens.
Don'tMake the current page a clickable link; this creates circular navigation.

Examples #

Breadcrumbs — Separators

Open in Playground

Swap the default slash for a chevron, an arrow, or a dot when the page calls for a different separator.

Breadcrumbs — Deep path

Open in Playground

A five-level trail for a deeply nested page, with a home icon on the root.

Breadcrumbs — Menu item

Open in Playground

A crumb in the middle of the trail opens a menu for switching between sibling destinations.

Breadcrumbs — Choose a team

Open in Playground

This crumb uses the menu slot for a radio group. Choosing a team renames the crumb.

Breadcrumbs — Variants

Open in Playground

The default trail next to the supporting variant, which stays quieter in a dense admin page.

Breadcrumbs — Icons

Open in Playground

Icons before the labels make the root and the settings section recognizable at a glance.