v0.0.2
Demos (demo panel, opens in a new tab)

Breadcrumb

A breadcrumb that shows where the page sits in the application.

zb:breadcrumb zubazar/ui · free (MIT)

Basic usage

Basic usage: view
BLADE

Pass the items in the items array in order, from the root to the page; you don't need to add the root.

blade
<zb:breadcrumb home-url="#" :items="[
    ['label' => 'Customers', 'url' => '#'],
    ['label' => 'Customer List', 'url' => '#'],
    ['label' => 'Edit'],
]" />
PropValues
items[['label' => …, 'url' => …], …]

With a route name

BLADE

Instead of a URL, pass a route name with the route key; the link is generated with route().

blade
<zb:breadcrumb :items="[
    ['label' => 'Customers', 'route' => 'customers.index'],
    ['label' => $customer->name],
]" />
PropValues
items[].routeRoute name
items[].urlDirect URL; takes precedence over route

Composable usage

Composable usage: view
BLADE

Instead of items, write the items with zb:breadcrumb.item; an item with href is a link, and one without it (or with current) is the current page.

blade
<div class="space-y-4">
    <zb:breadcrumb home-url="#">
        <zb:breadcrumb.item href="#">Stores</zb:breadcrumb.item>
        <zb:breadcrumb.item href="#">Kadıköy branch</zb:breadcrumb.item>
        <zb:breadcrumb.item>Orders</zb:breadcrumb.item>
    </zb:breadcrumb>

    <zb:breadcrumb home-url="#">
        <zb:breadcrumb.item href="#" class="flex items-center gap-1"><zb:icon name="building-storefront" size="4" /> Stores</zb:breadcrumb.item>
        <zb:breadcrumb.separator>/</zb:breadcrumb.separator>
        <zb:breadcrumb.item :separator="false">Kadıköy branch <zb:badge variant="warning">3 orders waiting</zb:badge></zb:breadcrumb.item>
    </zb:breadcrumb>
</div>
PropValues
zb:breadcrumb.itemhref, current, separator
zb:breadcrumb.separatorslot: separator (default: arrow)

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
items—[]['label' => …, 'url' => … | 'route' => …]; the last item and items without a URL are plain text
home-route—dashboardRoute name of the root link; the site root if the route does not exist
home-url—nullDirect URL of the root link
home-label—nullAccessible name of the root; defaults to "Home"
breadcrumb.item: href · current · separator—null · when no href · trueLink, current page (aria-current) and the separator before it
breadcrumb.separator— — Custom separator; an arrow when the slot is empty

Developer notes

Events, hooks and details
  • A root link with a home icon is added at the start automatically; the last item, even with a link, is rendered as plain text as the current page and gets aria-current="page".
  • The breadcrumb links open with wire:navigate.
  • Written item by item, items can carry rich content such as icons and badges, and the home link is still added. If you change the separator with zb:breadcrumb.separator, pass :separator="false" to the next item.
Zubazar UI · ZubazarDesigned for people.