PHPackages                             drpshtiwan/livewire-async-select - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. drpshtiwan/livewire-async-select

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

drpshtiwan/livewire-async-select
================================

A powerful async select component for Laravel Livewire with Alpine.js - a modern alternative to Select2

3.3.0(3w ago)1116.8k↓25.7%11MITPHPPHP ^8.2CI passing

Since Nov 2Pushed 3w agoCompare

[ Source](https://github.com/drpshtiwan/livewire-async-select)[ Packagist](https://packagist.org/packages/drpshtiwan/livewire-async-select)[ Docs](https://livewire-select.thejano.com)[ RSS](/packages/drpshtiwan-livewire-async-select/feed)WikiDiscussions main Synced yesterday

READMEChangelog (7)Dependencies (16)Versions (8)Used By (0)

Livewire Async Select
=====================

[](#livewire-async-select)

A powerful async select component for Laravel Livewire with Alpine.js - a modern, lightweight alternative to Select2.

[![Latest Version](https://camo.githubusercontent.com/8a0a51a9da1e5e68fd7556485587729df4345ac9f2dc8af956a27847d4a05c00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drpshtiwan/livewire-async-select)[![GitHub Tests Action Status](https://camo.githubusercontent.com/bc2f6a369b11c87b123621eda14e2dbb5a0c7aabb4d9bf6991c8727d033176ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563742f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/drpshtiwan/livewire-async-select/actions?query=workflow%3Atests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/d896573f7109b23a7c8b24e1ba28741ca13f08f0b4ca36cf3486746c9d6f47cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drpshtiwan/livewire-async-select)[![Code Style](https://camo.githubusercontent.com/3b3c737aea496c6e1d101e71596a571b3cb6f4e999ae19f620f7c7a1a211ba23/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d70696e742d6f72616e67653f7374796c653d666c61742d737175617265)](https://github.com/laravel/pint)[![License](https://camo.githubusercontent.com/54d61b2c268638450e726ad9eaeab86f28c32555f0b1c0231d2b0e6854177d70/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6472707368746977616e2f6c697665776972652d6173796e632d73656c6563743f7374796c653d666c61742d737175617265)](LICENSE)

🎥 Demo
------

[](#-demo)

[![Livewire Async Select Demo](assets/async-select.png)](https://www.youtube.com/watch?v=xwfKgZu49gg)

**[▶️ Watch Full Demo on YouTube](https://www.youtube.com/watch?v=xwfKgZu49gg)**

✨ Features
----------

[](#-features)

- 🚀 **Asynchronous Loading** - Load options dynamically from API endpoints
- 🔍 **Search &amp; 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-`
- 🔐 **Authentication Support** - Custom headers and internal authentication
- 🛡️ **Secure Internal Auth** - Signed tokens with replay protection

📚 Documentation
---------------

[](#-documentation)

**[📖 Full Documentation](https://livewire-select.thejano.com/)**

Complete guides, examples, and API reference available at:

### ****

[](#httpslivewire-selectthejanocom)

To build and view the documentation locally, see **[DOCS.md](DOCS.md)**.

⚡ Quick Install
---------------

[](#-quick-install)

1. **Install via Composer:**

```
composer require drpshtiwan/livewire-async-select
```

2. **Publish the CSS assets:**

```
php artisan vendor:publish --tag=async-select-assets
```

3. **Setup your layout (important!):**

```

    @asyncSelectStyles
    {{-- Optional: only if using Bootstrap 4 theme styling --}}
    {{-- @asyncSelectBootstrapV4Styles --}}
    @livewireStyles

    {{ $slot }}

    @livewireScripts
    @stack('scripts')  {{-- Required! --}}

```

> **⚠️ Important:** The `@stack('scripts')` directive is required for the component to work properly.

🎯 Basic Usage
-------------

[](#-basic-usage)

```

```

### Custom Slots (Livewire 3.3+ / 4.x)

[](#custom-slots-livewire-33--4x)

```

        {{ $option['label'] }}

        {{ $option['label'] }}

```

Slot variables are provided automatically:

- option slot: `$option`, `$isSelected`, `$isDisabled`, `$multiple`
- selected slot: `$option`

**API Route with async-auth middleware:**

```
// Default guard (web)
Route::middleware(['async-auth'])->get('/api/users/search', function (Request $request) {
    $users = User::where('name', 'like', "%{$request->get('search')}%")
        ->limit(20)
        ->get();

    return response()->json(['data' => $users]);
});

// With Sanctum
Route::middleware(['async-auth:sanctum'])->get('/api/users/search', function (Request $request) {
    // Works with Sanctum tokens or internal auth
    $users = User::where('name', 'like', "%{$request->get('search')}%")
        ->limit(20)
        ->get();

    return response()->json(['data' => $users]);
});

// With web guard and session persistence
Route::middleware(['web', 'async-auth:web,persist'])->get('/api/users/search', function (Request $request) {
    // Persists login in session
    $users = User::where('name', 'like', "%{$request->get('search')}%")
        ->limit(20)
        ->get();

    return response()->json(['data' => $users]);
});
```

The `async-auth` middleware is automatically registered and works exactly like `auth` middleware, but also handles internal authentication automatically when the `X-Internal-User` header is present. Supports all guards: `async-auth:web`, `async-auth:sanctum`, `async-auth:api`, etc.

**[→ View full documentation](https://livewire-select.thejano.com/)**

📋 Requirements
--------------

[](#-requirements)

- PHP 8.2+
- Laravel 11.x, 12.x, or 13.x
- Livewire 3.3+ or 4.x

🆚 Why This Package?
-------------------

[](#-why-this-package)

FeatureLivewire Async SelectSelect2jQuery Dependency❌ No✅ YesLivewire Integration✅ Native⚠️ ManualBundle Size🟢 Small🟡 LargeModern Stack✅ Yes❌ Legacy🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see the [documentation](https://drpshtiwan.github.io/livewire-async-select/) for details.

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

🙏 Credits
---------

[](#-credits)

- [Dr. Pshtiwan Mahmood](https://github.com/drpshtiwan)
- [All Contributors](https://github.com/drpshtiwan/livewire-async-select/contributors)

🔗 Links
-------

[](#-links)

- **[📚 Documentation](https://livewire-select.thejano.com/)**
- **[📦 Packagist](https://packagist.org/packages/drpshtiwan/livewire-async-select)**
- **[🐛 Issues](https://github.com/drpshtiwan/livewire-async-select/issues)**
- **[💬 Discussions](https://github.com/drpshtiwan/livewire-async-select/discussions)**

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~51 days

Total

7

Last Release

27d ago

Major Versions

1.1.0 → 2.0.02025-11-13

2.0.0 → 3.0.02026-02-11

PHP version history (2 changes)1.0.0PHP &gt;=8.1

3.3.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c3bae4eda28dfbd2e4a288a22c49c4a93c504c7b483e8d8353d7fea1eabcd921?d=identicon)[drpshtiwan](/maintainers/drpshtiwan)

---

Top Contributors

[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (46 commits)")[![gjm](https://avatars.githubusercontent.com/u/77360?v=4)](https://github.com/gjm "gjm (1 commits)")[![sergebenard](https://avatars.githubusercontent.com/u/18753991?v=4)](https://github.com/sergebenard "sergebenard (1 commits)")

---

Tags

laravelautocompletelivewiredropdownselectselect2alpinealpinejsasync-selectajax-select

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/drpshtiwan-livewire-async-select/health.svg)

```
[![Health](https://phpackages.com/badges/drpshtiwan-livewire-async-select/health.svg)](https://phpackages.com/packages/drpshtiwan-livewire-async-select)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[livewire/flux

The official UI component library for Livewire.

9527.8M128](/packages/livewire-flux)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[api-platform/laravel

API Platform support for Laravel

58171.4k14](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
