View laravel-hotwire on GitHub
1M
v0.91.0
Search 71 components and 72 controllers by name, category or description.
Multi Select
Searchable multi-value form control with selection limits and native submission
Options and trigger text
The name gets [] appended automatically and :selected is merged with old(). The trigger shows a count by default; list-all shows the labels instead, capped by list-all-limit.
Ana Lima
Bea Costa
Leo Martins
Rui Alves
No options found.
Ana Lima
Bea Costa
Leo Martins
Rui Alves
No options found.
{{-- The name gets [] appended automatically; :selected is merged with old(). --}}
<hw:field name="team" label="Default">
<hw:multi-select
placeholder="Select teammates"
:options="['ana' => 'Ana Lima', 'bea' => 'Bea Costa', 'leo' => 'Leo Martins', 'rui' => 'Rui Alves']"
:selected="['ana', 'leo']"
/>
</hw:field>
{{-- list-all shows the labels instead of a count, up to list-all-limit. --}}
<hw:field name="reviewers" label="list-all">
<hw:multi-select
placeholder="Select reviewers"
:options="['ana' => 'Ana Lima', 'bea' => 'Bea Costa', 'leo' => 'Leo Martins', 'rui' => 'Rui Alves']"
:selected="['ana', 'bea', 'leo', 'rui']"
list-all
:list-all-limit="2"
/>
</hw:field>
List behaviour
select-all adds a bulk action, max caps the selection, :search="false" drops the search box, sort-selected floats chosen options to the top, and close-list-on-item-select dismisses the panel after each pick.
Bug
Chore
Docs
Feature
Spike
No options found.
Development
Staging
Production
No options found.
{{-- select-all adds a bulk action; max caps the selection. --}}
<hw:field name="labels" label="select-all and max">
<hw:multi-select
placeholder="Pick up to 3"
:options="['bug' => 'Bug', 'chore' => 'Chore', 'docs' => 'Docs', 'feature' => 'Feature', 'spike' => 'Spike']"
select-all
:max="3"
/>
</hw:field>
{{-- No search box, selected options float to the top, panel closes on pick. --}}
<hw:field name="environment" label="No search, sorted, closes on select">
<hw:multi-select
placeholder="Select environments"
:options="['dev' => 'Development', 'stg' => 'Staging', 'prd' => 'Production']"
:selected="['stg']"
:search="false"
sort-selected
close-list-on-item-select
/>
</hw:field>
Placement
The floating listbox takes the same axes as Dropdown and Popover — side, align, the two offsets, and flip/shift to stay on screen.
Accessibility
Billing
Caching
No options found.
Accessibility
Billing
Caching
Nothing matches that search.
{{-- Same Floating UI axes as Dropdown and Popover: side, align, offsets,
and flip/shift to stay on screen. --}}
<hw:field name="topics_top" label="side=top, align=end">
<hw:multi-select
placeholder="Opens upwards"
:options="['a' => 'Accessibility', 'b' => 'Billing', 'c' => 'Caching']"
side="top"
align="end"
:side-offset="8"
/>
</hw:field>
<hw:field name="topics_wide" label="Custom width, no motion">
<hw:multi-select
placeholder="Wider panel"
:options="['a' => 'Accessibility', 'b' => 'Billing', 'c' => 'Caching']"
width="w-80"
motion="none"
empty-text="Nothing matches that search."
/>
</hw:field>