vlados/cascader
A cascading dropdown for Laravel Livewire and Alpine.js, inspired by Ant Design's Cascader. It renders a two-column desktop dropdown with search and a mobile bottom sheet, supports light and dark mode, two-level option arrays, and standard wire:model binding.
This release fixes every finding from a full package audit (#1–#12, PR #13). If you are on v0.4.0 or earlier, upgrade — the component's core feature was broken.
wire:model works again (#1). Since the wire:model rewrite in December, the Blade template and the Alpine component spoke different APIs: the entangle object was silently discarded, so selections never synced to Livewire, selected-state highlights and the clear button never rendered, and pre-selected values showed the placeholder. The Alpine component now owns a single modelValue (selectedValue remains as a deprecated alias), derives the trigger label from the options, and follows server-side changes. The selected-text prop and the deprecated wire-model prop work again.
Icon rendering hardened (#2). Icon names and colors are no longer concatenated into Blade template source — components render through x-dynamic-component with values passed as data, names are validated, colors sanitized, and rendered icons are memoized per request.
wire:model.live.debounce.500ms-style modifier chains detected correctly; no more attribute leaking onto the root element (#4)label-field takes priority; 0 is a valid value (#7)wire:navigate (#8)color-mix(), breakpoint-crossing handling (#9)illuminate/view/illuminate/contracts declared as dependencies (#10)wire:model (and the old wire-model prop) now actually work.selectedValue param to modelValue (the old name still works but is deprecated).Full details in CHANGELOG.md.
Full Changelog: https://github.com/vlados/cascader/compare/v0.3.0...v0.4.0
size prop with sm (default) and xs optionsdark: class variants$wire.entangle() for cleaner Livewire two-way bindingmin-width instead of fixed widthx-teleport to escape overflow: hidden containers (like modals), ensuring it's always visible above all contentNew useBladeFontAwesome() resolver for projects using the blade-fontawesome package:
use Vlados\Cascader\IconResolver;
IconResolver::useBladeFontAwesome(); // renders <x-fas-{icon} />
IconResolver::useBladeFontAwesome('far'); // renders <x-far-{icon} />
When an icon component cannot be found, you now get a clear, actionable error:
Cascader: Unable to render icon component '<x-fas-missing />'.
Original icon name: 'missing'.
Make sure the icon exists or configure a different IconResolver.
Available resolvers: useFontAwesome(), useBladeFontAwesome(), useHeroicons(), useBladeIcons(), or using() for custom.
| Method | Icon Name | Renders |
|---|---|---|
useFontAwesome() |
laptop |
<i class="fa-solid fa-laptop"> |
useBladeFontAwesome() |
laptop |
<x-fas-laptop /> |
useHeroicons() |
home |
<x-heroicon-s-home /> |
useBladeIcons() |
fas-laptop |
<x-fas-laptop /> |
The cascader now supports multiple icon libraries through a resolver system:
IconResolver::useFontAwesome()IconResolver::useHeroicons()IconResolver::useBladeIcons()IconResolver::using(fn($icon, $color, $size) => ...)// In AppServiceProvider::boot()
use Vlados\Cascader\IconResolver;
// Use Heroicons instead of FontAwesome
IconResolver::useHeroicons('outline');
// Or create a custom resolver
IconResolver::using(function (string $icon, ?string $color, string $size) {
return view('components.my-icon', compact('icon', 'color', 'size'))->render();
});
x-html for dynamic icon renderingHow can I help you explore Laravel packages today?