Download the PHP package etdte/livewire-multiselect without Composer
On this page you can find all versions of the php package etdte/livewire-multiselect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download etdte/livewire-multiselect
More information about etdte/livewire-multiselect
Files in etdte/livewire-multiselect
Package livewire-multiselect
Short Description Livewire multiselect
License proprietary
Informations about the package livewire-multiselect
Livewire multiselect component
Requirements
Installation
You can install the package via composer:
Usage
1) Add trait to your component
2) Add variables for an available options and a selected ones to your component
3) Add the select to your page
4) Add select listener to your component (only for Livewire v2)
If you're using Livewire v2, you need to manually add the event listener in your component:
For Livewire v3, this is no longer needed.
Events
Multiselect component emits a event, which is caught by trait and sets values to a proper variables in your component.
This trait also calls function on your component, if it exists, and passes a select name and selected items. You can define a method in your component to react on the changes:
Works only if
multiselect
select
Props
Property | Arguments | Default | Example |
---|---|---|---|
trackBy | \<String> - Used to compare objects. | id | |
label | \<String> - Object property in option, that will be visible in the dropdown. | name | |
name | \<String> - Used to name inputs & identify multiple selects on a page. Must be the same as a variable name in your component which accepts selected items |
required | |
options | \<Illuminate\Support\Collection> - Available options. | required | |
selected | \<Array,Integer,String> - Used to define selected options on a page loading. Variable name should be the same as a prop value. |
||
title | \<String> - Label title for the select on a page. | ||
multiselect | \<Boolean> - Determines if the select is multiple. | ||
showEmptyOption | \<Boolean> - Determines if an empty option displays on the select. Works only for single selects () |
||
simpleForm | \<Boolean> - Determines if a html input should be added to a page. Useful when a select is placed outside a livewire component, like a html form which makes a regular http request. |
||
parentId | \<String> - Determines which component a select belongs to. Highly recommended to define it when you have more then one level component depth, with the same selects name on each level. |
||
styles | \<String> - Classes of the root select wrapper. | col-span-1 |
Additional functionality
You can refresh selected items by calling in your component
You can also refresh available options
Customizing
You can customize a select look by publishing its view
License
The MIT License (MIT). Please see License File for more information.
All versions of livewire-multiselect with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
livewire/livewire Version ^3.0