Package
Drpshtiwan Livewire Async Select
A powerful async select component for Laravel Livewire with Alpine.js - a modern alternative to Select2
Livewire Async Select
A powerful async select component for Laravel Livewire with Alpine.js - a modern, lightweight alternative to Select2.
π₯ Demo
βΆοΈ Watch Full Demo on YouTube
β¨ Features
- π Asynchronous Loading - Load options dynamically from API endpoints
- π Search & Filter - Built-in search with debouncing
- π― Multiple Selection - Beautiful chip/tag display
- β‘ Alpine.js Powered - Lightweight, no jQuery dependency
- π¨ Styled with Tailwind CSS - Pre-built styles with
las-prefix - π Custom Slots - Fully customizable rendering
- π¦ Easy Integration - Native Livewire component
- π Two-way Binding - Full wire:model support
- π No Style Conflicts - All classes prefixed with
las-
π Documentation
Complete guides, examples, and API reference available at:
https://livewire-select.thejano.com/
To build and view the documentation locally, see DOCS.md.
β‘ Quick Install
- Install via Composer:
composer require drpshtiwan/livewire-async-select
- Publish the CSS assets:
php artisan vendor:publish --tag=async-select-assets
- Setup your layout (important!):
<head> @asyncSelectStyles @livewireStyles </head> <body> {{ $slot }} @livewireScripts @stack('scripts') {{-- Required! --}} </body>
β οΈ Important: The
@stack('scripts')directive is required for the component to work properly.
π― Basic Usage
<livewire:async-select name="user_id" wire:model="selectedUser" endpoint="/api/users/search" placeholder="Search users..." />
π Requirements
- PHP 8.1+
- Laravel 10.x, 11.x, or 12.x
- Livewire 3.3+
π Why This Package?
| Feature | Livewire Async Select | Select2 |
|---|---|---|
| jQuery Dependency | β No | β Yes |
| Livewire Integration | β Native | β οΈ Manual |
| Bundle Size | π’ Small | π‘ Large |
| Modern Stack | β Yes | β Legacy |
π€ Contributing
Contributions are welcome! Please see the documentation for details.
π License
The MIT License (MIT). Please see License File for more information.
