#420
Multiple
A multi-select Combobox with removable chips, starting with two labels selected and echoing the array below.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Multiple" pattern (@codeatlasdev/ui demo #420, inputs/combobox) in my app.
Call get_demo({ ids: ["#420"] }) first and keep its structure. It needs @codeatlasdev/[email protected].
Use: Choosing several items from a searchable list, such as labels or categories, where the list stays open between picks.
Keep these library parts, with the props and tokens the demo uses:
- Combobox from "@codeatlasdev/ui"
Behaviour to keep:
- `multiple`, `label="Labels"`, `options={labels}` and `bind:value={selected}` on one `Combobox`
- `const labels` has 6 options, `legacy` is `disabled: true`
- `let selected = $state<string[]>(['bug', 'ui'])` renders two chips on first paint
- `description` hints that Backspace on an empty search removes the last chip
- Output line `Selected:` joins the array with `, ` or shows `none`
- Wrapper `.col` has `max-width: 360px`
Reduced motion: the demo handles it; keep that branch.
Keyboard: operable; keep the focus order and key handling.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Combobox
@codeatlasdev/ui
How it is built
- `multiple`, `label="Labels"`, `options={labels}` and `bind:value={selected}` on one `Combobox`
- `const labels` has 6 options, `legacy` is `disabled: true`
- `let selected = $state<string[]>(['bug', 'ui'])` renders two chips on first paint
- `description` hints that Backspace on an empty search removes the last chip
- Output line `Selected:` joins the array with `, ` or shows `none`
- Wrapper `.col` has `max-width: 360px`
Related
Loading source.