Multi-Select
A filterable tag combobox — the multi-value sibling of Combobox. Picks render as removable chips at the start of one bordered control; a combobox input filters the remaining options in a listbox popup. Selecting an option ADDS it and keeps the popup open so you can add several. State is controlled through a @change callback that fires with the next array of values.
Installation
Copy the piece into your app — it compiles with your build and the code is yours:
puzzle add piece multi-select
No npm dependencies. Requires the pieces.css tokens merged into your app styles (see Introduction).
Usage
import MultiSelect from '@/components/ui/MultiSelect.pzl';
<MultiSelect options={ frameworks } value={ picks } @change={ setPicks } />// The option element, ARIA, and handlers stay owned by MultiSelect.
// Selected entries render as stock chips and are absent from the option list.
<MultiSelect options={ people } value={ picks } @change={ setPicks }>
<Snippet fits="option" item active selected disabled>
<img class="size-6 rounded-full" src={ item.avatar } alt="" />
<span class="truncate">{ item.name }</span>
</Snippet>
</MultiSelect>Basic usage
value is an array; each pick becomes a chip. Selected options are hidden from the list — remove a chip (its ×, or Backspace on an empty input) to bring it back.
Pick the ones you've shipped with
Groups and dividers
Error state
Pick at least one framework
Controlled open
Open state is optional-controlled. Omit open and the component owns it; pass it and the parent does, reacting to @show and @hide.
Parent open state: closed
Keyboard
Focus stays on the input; these keys drive the control:
- Type — re-filters and opens the list, reseating the active option
- Down / Up arrows — open the list, then move the active option (wraps, skips disabled)
- Home / End — jump to the first or last option
- Enter — add the active option (query clears, popup stays open)
- Backspace — on an empty input, remove the last chip
- Escape — close the list
- Tab — close and move focus on naturally