The Svelte component is source code that the installer copies into your app.
Install
composer require meirdick/auto-search-chips
php artisan search-chips:install --stack=svelteThe installer detects Svelte when @inertiajs/svelte is in package.json. It copies core.ts and SearchChips.svelte to resources/js/components/search-chips/. The component imports @inertiajs/svelte and lucide-svelte, and uses Svelte 5 runes.
Tailwind
The files are in resources/js, so Tailwind scans them. You need no @source line.
Controller
The controller is the same as for React.
Page
<SearchChips for="posts" initial={searchChips} reload={['posts', 'searchChips']} />Props
| Prop | Meaning |
|---|---|
for |
The registered alias. Required. |
placeholder |
The placeholder. Default Search…. |
initial |
The searchChips prop from the controller. |
reload |
Inertia props to reload when the filters change. |
onfilters |
A callback for the settled filters. |
options |
Partial<SearchChipsOptions>. See Headless core. |
No filter panel
The Svelte component has the search box and the chip row. It has no filter panel.