Skip to content

Breadcrumb

Breadcrumb navigation helps users understand their location in a hierarchy and navigate back.


Demo

Basic (3 levels)

Deep hierarchy (5 levels)

Custom separator


When to use

  • Multi-level navigation hierarchies (e.g. e-commerce categories, documentation)
  • When users need to understand where they are in a structure
  • As secondary navigation alongside primary nav

When not to use

  • Flat site structures with only one level
  • Mobile apps (use back-navigation instead)
  • Single-page flows / wizards (use a step indicator)

Installation

bash
pnpm add @grundtone/vue

Usage

Basic

vue
<template>
  <GTBreadcrumb
    :items="[
      { label: 'Home', href: '/' },
      { label: 'Blog', href: '/blog' },
      { label: 'Current Post' },
    ]"
  />
</template>

With Vue Router

vue
<template>
  <GTBreadcrumb
    :items="[
      { label: 'Home', to: '/' },
      { label: 'Products', to: { name: 'products' } },
      { label: 'T-shirt' },
    ]"
  />
</template>

Custom separator

vue
<template>
  <GTBreadcrumb
    separator="→"
    :items="[
      { label: 'Dashboard', href: '/dashboard' },
      { label: 'Settings', href: '/settings' },
      { label: 'Profile' },
    ]"
  />
</template>

Responsive behavior

On screens narrower than 640px, only the last two items (parent + current page) are shown. This prevents long breadcrumb trails from wrapping on mobile.


Props

PropTypeDefaultDescription
itemsBreadcrumbItem[]requiredArray of breadcrumb items
separatorstring"/"Separator character between items
ariaLabelstring"Breadcrumb"Accessible label for the <nav> element
PropertyTypeDescription
labelstringVisible text
hrefstring?URL for plain <a> link
tostring | object?Vue Router destination (renders <router-link>)

The last item is always treated as the current page. Items without href or to also render as current (non-link).


Accessibility

  • <nav> landmark with aria-label="Breadcrumb"
  • <ol> ordered list — conveys hierarchy to screen readers
  • aria-current="page" on the current (last) item
  • Separators use aria-hidden="true" — not announced by screen readers

CSS Classes

ClassElement
.gt-breadcrumb<nav> root
.gt-breadcrumb__list<ol> list
.gt-breadcrumb__item<li> item
.gt-breadcrumb__link<a> or <router-link>
.gt-breadcrumb__separatorSeparator span
.gt-breadcrumb__currentCurrent page span

Design system

The CSS-only version of this component is documented in the Design System — Breadcrumb reference.