Skip to main content
You are viewing Pre-Alpha documentation.
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

createBreadcrumbs

A composable that extends createSingle for breadcrumb navigation with automatic path truncation.


IntermediateApr 6, 2026

Usage

The createBreadcrumbs composable manages an ordered path of items. When you select an earlier item, everything after it is removed. Use values() to iterate the current trail for rendering.

A clickable file-path breadcrumb trail — selecting an earlier crumb truncates everything after it.

Depth: 6 · At root: false

Context / DI

Use createBreadcrumbsContext to share a breadcrumbs instance across a component tree:

ts
import { createBreadcrumbsContext } from '@vuetify/v0'

export const [useBreadcrumbs, provideBreadcrumbs, breadcrumbs] =
  createBreadcrumbsContext({ namespace: 'my:breadcrumbs' })

// In parent component
provideBreadcrumbs()

// In child component
const nav = useBreadcrumbs()
nav.register({ text: 'Settings' })

Architecture

createBreadcrumbs extends createSingle with path truncation and derived navigation state:

Breadcrumbs Hierarchy

Use controls to zoom and pan. Click outside or press Escape to close.

Breadcrumbs Hierarchy

The Breadcrumbs component consumes createBreadcrumbs as its backing model, similar to how Tabs.Root uses createStep.

Reactivity

Breadcrumb state is always reactive. All derived properties update automatically when items are registered, unregistered, or navigated.

Property/MethodReactiveNotes
depthRef — count of registered items
isRootRef — depth <= 1
isEmptyRef — depth === 0
selectedIdComputed — current (last) item ID
selectedItemComputed — current item ticket
selectedValueComputed — current item value
selectedIndexComputed — current item position
Tip

Depth tracking Use depth, isRoot, and isEmpty to conditionally render navigation controls like a “Back” button or hide the breadcrumb trail when at the root level.

Examples

File Explorer

A file explorer that uses createBreadcrumbs to track the user’s position in a folder tree. Clicking a folder calls register() to push it onto the trail, while clicking a breadcrumb calls select() to navigate back — automatically truncating everything after the selected crumb.

File breakdown:

FileRole
file-explorer.vueInteractive file browser with breadcrumb navigation and back button
tree.tsTyped folder tree data and FolderNode interface

Key patterns:

  • FileBreadcrumbTicketInput extends BreadcrumbTicketInput<FolderNode> so selectedValue is properly typed — no casting needed

  • Each folder node is stored as the ticket’s value, keeping the breadcrumb trail and folder listing in sync through the registry itself

  • isRoot controls whether the back button is visible

Drill into Home > Documents > Projects > v0-app > src to see the trail grow, then click an earlier crumb to truncate back.

Depth: 1 · At root: true

API Reference

The following API details are for the createBreadcrumbs composable.

Functions

createBreadcrumbs

(options?: BreadcrumbsOptions) => R

Creates a breadcrumbs navigation model.

createBreadcrumbsContext

(_options?: BreadcrumbsContextOptions) => ContextTrinity<R>

Creates a breadcrumbs context for dependency injection.

useBreadcrumbs

(namespace?: string) => R

Returns the current breadcrumbs instance from context.

Options

events

boolean | undefined

Enable event emission for registry operations

Default: false

reactive

boolean | undefined

Enable reactive behavior for registry operations

Default: false

disabled

MaybeRefOrGetter<boolean> | undefined

Disabled state for the entire model instance

Default: false

enroll

MaybeRefOrGetter<boolean> | undefined

Auto-select tickets on registration

Default: true

multiple

MaybeRefOrGetter<boolean> | undefined

Allow multiple tickets to be selected simultaneously

Default: false

mandatory

MaybeRefOrGetter<boolean | "force"> | undefined

Controls mandatory selection behavior: - `false` (default): No mandatory selection enforcement - `true`: Prevents deselecting the last selected item - `'force'`: Automatically selects the first non-disabled item on registration

Properties

collection

ReadonlyMap<ID, E>

The collection of tickets in the registry

size

number

The number of tickets in the registry

selectedIds

Reactive<Set<ID>>

Set of currently selected ticket IDs

selectedItems

ComputedRef<Set<E>>

Computed Set of selected ticket instances

selectedValues

ComputedRef<Set<E["value"] extends Ref<infer U, infer U> ? U : E["value"]>>

Computed Set of selected ticket values

disabled

MaybeRefOrGetter<boolean>

Disabled state for the entire model instance

multiple

MaybeRefOrGetter<boolean>

Whether the selection allows multiple selections

selectedId

ComputedRef<ID | undefined>

selectedIndex

ComputedRef<number>

selectedItem

ComputedRef<E | undefined>

selectedValue

ComputedRef<E["value"] | undefined>

depth

Readonly<Ref<number, number>>

Number of items in the path

isRoot

Readonly<Ref<boolean, boolean>>

Whether at root level (depth <= 1)

isEmpty

Readonly<Ref<boolean, boolean>>

Whether path is empty (depth === 0)

Methods

clear

() => void

Clear the entire registry

has

(id: ID) => boolean

Check if a ticket exists by ID

keys

() => readonly ID[]

Get all registered IDs

browse

(value: E["value"]) => ID[] | undefined

Browse for an ID(s) by value

lookup

(index: number) => ID | undefined

lookup a ticket by index number

get

(id: ID) => E | undefined

Get a ticket by ID

upsert

(id: ID, ticket?: Partial<Z>, event?: string) => E

Update or insert a ticket by ID

values

() => readonly E[]

Get all values of registered tickets

entries

() => readonly [ID, E][]

Get all entries of registered tickets

unregister

(id: ID) => void

Unregister a ticket by ID

reindex

() => void

Reset the index directory and update all tickets

move

(id: ID, toIndex: number) => E | undefined

Seek for a ticket based on direction and optional predicate

seek

(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => E | undefined

on

<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<E, K>) => void

Listen for registry events

off

<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<E, K>) => void

Stop listening for registry events

emit

<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => void

Emit an event with data

dispose

() => void

Clears the registry and removes all listeners

offboard

(ids: ID[]) => void

Offboard multiple tickets at once

batch

<R>(fn: () => R) => R

Execute operations in a batch, deferring cache invalidation and event emission until complete

reset

() => void

Reset selection state without destroying the registry

unselect

(id: ID) => void

Unselect a ticket by ID

toggle

(id: ID) => void

Toggle a ticket's selection state

selected

(id: ID) => boolean

Check if a ticket is currently selected

apply

(values: unknown[], options?: { multiple?) => void

Apply external values to the model

mandate

() => void

Mandate selected ID based on "mandatory" option

register

(ticket?: Partial<Z>) => E

Register a new ticket (accepts input type, returns output type)

onboard

(registrations: Partial<Z>[]) => E[]

Onboard multiple tickets at once

first

() => void

Navigate to root (first item)

prev

() => void

Navigate up one level (remove last item)

select

(id: ID) => void

Navigate to specific item by id (truncates path)

Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/