Breadcrumbs
Alignment target:@astryxdesign/core v0.7.1 · Breadcrumbs
Usage #
Import Breadcrumbs and BreadcrumbItem from their dedicated entry.
<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
| Element | Description |
|---|---|
| Trail | The ordered list of links from root to current page. |
| Item | A single step in the trail. Renders as a link or plain text for the current page. |
| Separator | The character between items. Defaults to "/" but can be customized. |
| Icon | An optional icon before an item label, like a home icon on the first item. |
Best practices #
| Guidance | Practice |
|---|---|
| Recommended | Use semantic <nav> and <ol> markup so screen readers can identify the path. |
| Recommended | Use is-current for the current page and render it as a <span> with aria-current="page". |
| Recommended | Keep separators decorative with aria-hidden="true". |
| Don't | Use overly long labels that wrap awkwardly on small screens. |
| Don't | Make the current page a clickable link; this creates circular navigation. |
Examples #
Breadcrumbs — Separators
Swap the default slash for a chevron, an arrow, or a dot when the page calls for a different separator.
Breadcrumbs — Deep path
A five-level trail for a deeply nested page, with a home icon on the root.
Breadcrumbs — Menu item
A crumb in the middle of the trail opens a menu for switching between sibling destinations.
Breadcrumbs — Choose a team
This crumb uses the menu slot for a radio group. Choosing a team renames the crumb.
Breadcrumbs — Variants
The default trail next to the supporting variant, which stays quieter in a dense admin page.
Breadcrumbs — Icons
Icons before the labels make the root and the settings section recognizable at a glance.