Breadcrumb
VBreadcrumb displays a navigation trail from an item array and marks the current page using its URL.
Usage
vue
Examples
Custom separator
separatorIcon replaces the separator between segments.
vue
With icons
Each item can include a decorative icon beside its label.
vue
Truncation
Beyond maxItems, the trail keeps the first and last two items. An ellipsis menu lists the hidden items.
vue
Router
Each segment is a real <a>. A click emits navigate with the item and the event: with Nuxt or Vue Router, call preventDefault() and push item.href. A click with a modifier key emits nothing and still opens a new tab.
vue
<VBreadcrumb
:items="items"
:current-path="$route.path"
@navigate="(item, event) => { event.preventDefault(); $router.push(item.href) }"
/>API
Props
| Prop | Type | Default |
|---|---|---|
items | BreadcrumbItem[] | none |
| Trail items, from the root to the current level. | ||
label | string | none |
| Accessible navigation name. Defaults to the dictionary. | ||
currentPath | string | none |
| URL used to identify the current item. Trailing slashes, query strings and hashes are ignored. | ||
separatorIcon | IconSource | chevron_right |
| Separator icon. Mirrors in right-to-left layouts. | ||
maxItems | number | none |
| Truncation threshold, with an effective minimum of 3. | ||
ellipsisLabel | string | none |
| Accessible ellipsis menu name. Defaults to the dictionary. | ||
Events
| Event | Type |
|---|---|
navigate | [item: BreadcrumbItem, event: MouseEvent] |
Segment followed, from the trail or the ellipsis menu. Receives the item and click event; call preventDefault() for routing. Modified clicks do not emit it. | |
Types
Types used in the API tables. Import exported types from vectis-ui.
export interface BuiltinIcon {
name: string
paths: readonly [string] | readonly [string, string]
}export type IconRender =
| { path: string; viewBox?: string }
| { component: Component; props?: Record<string, unknown> }
| { src: string }
| { text: string; class?: string }
| { class: string }export type IconSource = string | BuiltinIcon | IconRender