Components
Breadcrumb
Shows the path to the current page with accessible navigation semantics.
Installation
$ npx veil-ui@latest add breadcrumbUsage
import {
Breadcrumb,
BreadcrumbList,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="/">Home</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>Components</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>;Examples
Basic
Collapsed
Custom separator
With icon
API reference
Breadcrumb
| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | "breadcrumb" | Name of the navigation landmark. |
BreadcrumbLink
| Prop | Type | Default | Description |
|---|---|---|---|
| asChild | boolean | false | Render your router link instead of an anchor. |
BreadcrumbPage marks the current item with aria-current="page".
Accessibility
- Renders a
<nav>with an accessible name, plus an ordered list for structure. - Separators are presentational and hidden from assistive technology.
- The collapsed item announces “More pages” through visually hidden text.
- Use
asChildonBreadcrumbLinkto keep client-side routing.
Vue and plain HTML
This component also ships for Vue (Reka UI) and plain HTML. Install it with npx veil-ui add breadcrumb --framework vue or switch the framework in components.json.
<script setup lang="ts">
import { cn } from "@/lib/utils";
const props = defineProps<{ class?: string }>();
</script>
<template>
<nav
data-slot="breadcrumb"
aria-label="breadcrumb"
:class="cn('w-full', props.class)"
>
<slot />
</nav>
</template>