<x-widget.breadcrumbs>
Breadcrumbs Blade component for Laravel and Livewire
Where a page sits: a trail of links from the top down to the current page, which screen readers hear as such. On phones, a single link back up instead. Chevron or slash between the steps, an icon for Home, and long labels cut short with the full text on hover.
php artisan bladewell:add breadcrumbs
- Also adds
- Icon
- Works with
- Laravel 12 and 13, Livewire 3 and 4, Tailwind CSS 4.1+, PHP 8.3+
Examples
Basic
From the top down; the last is the page you're on. Make the browser window narrow to see the phone version: one link back up.
Show code Hide code
<x-widget.breadcrumbs :items="[
['label' => 'Home', 'href' => '#'],
['label' => 'Orders', 'href' => '#'],
'Order #1042',
]" />
Home icon
iconOnly shows Home as an icon alone, still named "Home" for screen readers. separator="slash" for a lighter look.
Show code Hide code
<x-widget.breadcrumbs separator="slash" :items="[
['label' => 'Home', 'href' => '#', 'icon' => 'home', 'iconOnly' => true],
['label' => 'Settings', 'href' => '#'],
'Billing',
]" />
Long trail
A deep trail wraps onto a second line, and a long label is cut short with the full text in its tooltip.
Show code Hide code
<x-widget.breadcrumbs class="max-w-md" :items="[
['label' => 'Home', 'href' => '#', 'icon' => 'home'],
['label' => 'Projects', 'href' => '#'],
['label' => 'Website redesign for the spring campaign', 'href' => '#'],
['label' => 'Files', 'href' => '#'],
'homepage-hero-final-v3.png',
]" />
Props
Other attributes, such as autocomplete or data-*, are passed through to the element. class styles the component's outer wrapper.
<x-widget.breadcrumbs>
| Prop | Default | Description |
|---|---|---|
| items | Required | The trail, from the top: each a label, or ['label' => 'Orders', 'href' => route('orders.index')], plus 'icon' => 'home' for an icon before it, and 'iconOnly' => true to show the icon alone (the label still names it). The last is the page you're on. |
| label |
'Breadcrumb'
|
The trail's name for screen readers. |
| separator |
'chevron'
|
What sits between the steps: chevron or slash. |
| collapse |
true
|
On phones, only a link back to the page above ("← Orders"), as a whole trail wouldn't fit. The full trail from sm up. |
Accessibility
All 3 examples above are checked with axe-core against the WCAG 2.2 A and AA rules, in the light theme and the dark one, both as the page draws and with each popover, dialog, toast and tooltip opened, on every change. A change that fails can't be merged. Where axe can't decide, such as contrast on SVG text, the test measures the colours itself instead of letting it pass.
Automated checks can't judge everything: how it sounds in a screen reader, and how it feels to use from the keyboard, still need a person. Check those on your own pages too.
Source
What bladewell:add breadcrumbs writes to your app with the default namespaces. Prefer to copy by hand? Take these files, plus the ones from
the components it also adds , and the theme and base CSS.
resources/views/components/widget/breadcrumbs/index.blade.php Show