New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

pharaonic/livewire-select2

Select2 for Livewire components: two-way wire:model binding, dynamic elements, and templates, on Livewire Assistant.
90,489 45
Install
composer require pharaonic/livewire-select2
Latest Version:4.0.0
PHP:>=8.1 <8.6
Laravel:10 – 13
Older releases:7 · 8 · 9
License:MIT
Last Updated:Oct 24, 2026
Links: GitHub  ·  Packagist
Maintainer: Pharaonic

Livewire Select2

PHP Version : 8.1 - 8.5 Laravel Version : 10.x - 13.x Livewire Version : 4.x License Build
Source Packagist Version Packagist Downloads

Select2 for Livewire components.

Two-way wire:model binding, dynamic and dependent selects, and templates, built on Livewire Assistant.

Installation

composer require pharaonic/livewire-select2

Load jQuery and Select2 as usual, then add the scripts once in your layout, before or after @livewireScripts:

@livewireScripts
@livewireSelect2Scripts

No Node build is needed. The 4.x line supports Livewire 4.3.4+ on Laravel 10.16+, 11, 12, and 13 with PHP 8.1 to 8.5.

Coming from 1.2? Run composer require pharaonic/livewire-select2:^4.0. Your markup keeps working; the documentation lists what changed.

Usage

<div wire:ignore>
    <select data-pharaonic="select2" wire:model.live="country" data-placeholder="Choose a country" data-clear>
        <option value=""></option>
        <option value="1">Egypt</option>
        <option value="2">Jordan</option>
    </select>
</div>

The select follows country both ways: picking an option updates the component, and setting the property on the server updates the widget. Shorthands such as data-tags, data-clear, data-search-off, and data-parent cover common options; data-options takes any other Select2 option as JSON.

Documentation

Read the full Livewire Select2 documentation for options, dependent selects, templates, bundlers such as Vite, and upgrading from 1.2.

Support & Security

See SUPPORT.md and SECURITY.md.

License

MIT. See LICENSE.

Related Packages

williamug/searchable-select

A beautiful, searchable dropdown component for Laravel Livewire 3 & 4 applicatio...

1,848 2
drpshtiwan/livewire-async-select

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

10,775 112
pharaonic/livewire-assistant

Shared Blade and JavaScript foundation that binds JavaScript widgets to Livewire...

1,780 1
rishadblack/wire-tomselect

Searchable Livewire dropdowns backed by Tom Select

969 4
mrshanebarron/select

Select dropdown component for Laravel - supports Livewire and Vue

8 0

Version History

Version Released PHP Laravel License
4.0.0 >=8.1 <8.6 ^10.16 || ^11.0 || ^12.0 || ^13.0 MIT
3.0.0 >=8.1 <8.6 ^10.15 || ^11.0 || ^12.0 || ^13.0 MIT
2.0.1 >=8.0 <8.4 ^7.30 || ^8.75 || ^9.0 || ^10.0 MIT
2.0.0 >=8.0 <8.4 ^7.30 || ^8.75 || ^9.0 || ^10.0 MIT
1.3.2 >=7.4 <8.0 ^7.30 || ^8.75 MIT