Skip to content

Breadcrumb ​

A navigation component that shows the current page's location within the site hierarchy. Supports collapsing, dropdowns, icons, sizes, loading state, truncation, custom separators, slots, and full class customization.

Basic ​

vue
<script setup>
import { VxBreadcrumb } from 'veloxui'

const items = [
  { label: 'Home', href: '/' },
  { label: 'Products', href: '/products' },
  { label: 'Electronics', href: '/products/electronics' },
  { label: 'Headphones' },
]
</script>

<template>
  <VxBreadcrumb :items="items" />
</template>

Sizes ​

Three sizes: small, default, and large.

default
vue
<VxBreadcrumb :items="items" size="small" />
<VxBreadcrumb :items="items" size="default" />
<VxBreadcrumb :items="items" size="large" />

Separators ​

Choose from built-in separators or pass a custom string.

slash
dot
dash
vue
<VxBreadcrumb :items="items" separator="slash" />
<VxBreadcrumb :items="items" separator="arrow" />
<VxBreadcrumb :items="items" separator="dot" />
<VxBreadcrumb :items="items" separator="dash" />

Custom Separator ​

Pass any string as the separator, or use the #separator slot.

vue
<VxBreadcrumb :items="items" separator="|" />
<VxBreadcrumb :items="items" separator="→" />

<VxBreadcrumb :items="items">
  <template #separator>
    <MyIcon />
  </template>
</VxBreadcrumb>

Icons ​

Set icon on items to show built-in icons: home, folder, file, settings. Or use the #icon slot for custom icons.

vue
<VxBreadcrumb :items="[
  { label: 'Home', href: '/', icon: 'home' },
  { label: 'Documents', href: '/docs', icon: 'folder' },
  { label: 'Report.pdf', icon: 'file' },
]" separator="arrow" />

Collapsed (Expand) ​

Use max-items to collapse long breadcrumbs. Click the ellipsis to expand.

vue
<VxBreadcrumb :items="items" :max-items="3" />

Collapsed (Dropdown) ​

Set collapse-mode="dropdown" to show hidden items in a dropdown popover.

vue
<VxBreadcrumb
  :items="items"
  :max-items="3"
  collapse-mode="dropdown"
/>

Truncation ​

Use max-width to truncate long labels with ellipsis. Hover to see the full text.

vue
<VxBreadcrumb :items="items" :max-width="120" />

Loading ​

Show a skeleton placeholder while data is loading.

vue
<VxBreadcrumb :items="items" loading />

Disabled Items ​

Individual items can be disabled.

vue
<VxBreadcrumb :items="[
  { label: 'Home', href: '/' },
  { label: 'Archived', href: '/archived', disabled: true },
  { label: 'Old Page' },
]" />

Custom Item Slot ​

Use the #item slot for custom rendering. Receives item, index, and active.

vue
<VxBreadcrumb :items="items">
  <template #item="{ item, active }">
    <MyIcon :name="item.icon" />
    {{ item.label }}
  </template>
</VxBreadcrumb>

Exposed Methods ​

Access expand(), collapse(), and isCollapsed via template ref.

vue
<script setup>
import { ref } from 'vue'
const breadcrumbRef = ref()

function toggleCollapse() {
  if (breadcrumbRef.value.isCollapsed) {
    breadcrumbRef.value.expand()
  } else {
    breadcrumbRef.value.collapse()
  }
}
</script>

<template>
  <VxBreadcrumb ref="breadcrumbRef" :items="items" :max-items="3" />
  <button @click="toggleCollapse">Toggle</button>
</template>

Custom Classes ​

Override styling with root-class, item-class, active-class, and separator-class.

vue
<VxBreadcrumb
  :items="items"
  root-class="my-breadcrumb"
  item-class="my-item"
  active-class="my-active"
  separator-class="my-sep"
/>

API ​

VxBreadcrumb Props ​

PropTypeDefaultDescription
itemsBreadcrumbItem[][]Breadcrumb items
separator'slash' | 'arrow' | 'dot' | 'dash' | string'slash'Separator between items
size'small' | 'default' | 'large''default'Size variant
max-itemsnumber0Max visible items (0 = show all). Collapses middle items.
collapse-mode'expand' | 'dropdown''expand'How collapsed items are revealed
max-widthnumber0Max width in px for each label. Truncates with ellipsis.
loadingbooleanfalseShow skeleton loading state
root-classstring | string[] | object—Class on root <nav>
item-classstring | string[] | object—Class on every link
active-classstring | string[] | object—Class on the current (last) item
separator-classstring | string[] | object—Class on separator elements
PropertyTypeRequiredDescription
labelstringYesDisplay text
hrefstringNoLink URL
tostring | objectNoVue Router destination (renders <router-link>)
iconstringNoBuilt-in icon: home, folder, file, settings
disabledbooleanNoDisable this item

Events ​

EventPayloadDescription
click(item, index, event)Item clicked
expand—Collapsed items expanded
collapse—Items collapsed again

Slots ​

SlotPropsDescription
item{ item, index, active }Custom item content
icon{ item }Custom icon per item
separator—Custom separator content
ellipsis{ expand, toggleDropdown, collapsedItems }Custom ellipsis button

Exposed ​

NameTypeDescription
expand()() => voidExpand collapsed items
collapse()() => voidCollapse items again
isCollapsedbooleanCurrent collapse state