Coverage areas
One or more
Search the available places and keep the ones the project covers.
Selects multiple predefined options from a searchable native disclosure with named checkboxes.
One or more
Search the available places and keep the ones the project covers.
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { MultiSelect } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/multi-select.
npx @noorddev/vlak-cli add multi-select
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/multi-select.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { MultiSelect } from "@noorddev/vlak-react";
<MultiSelect label="Cities" name="cities" options={[{ value: "alkmaar", label: "Alkmaar" }, { value: "bergen", label: "Bergen" }, { value: "castricum", label: "Castricum" }]} defaultValue={["alkmaar"]} />A native disclosure containing named checkboxes; selections remain visible when collapsed.
| Prop | Type | Default | Description |
|---|---|---|---|
optionsrequired | MultiSelectOption[] | ||
value | string[] | ||
defaultValue | string[] | [] | |
onValueChange | (value: string[]) => void | ||
label | ReactNode | "Options" | |
placeholder | string | "Select options" | |
searchable | boolean | true | |
searchLabel | string | "Filter options" | |
emptyLabel | ReactNode | "No matching options" | |
clearLabel | string | "Clear selection" |
Also accepts Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange" | "defaultValue">.
| Keys | Does |
|---|---|
| Enter, Space | Opens or closes the native summary, or toggles the focused checkbox. |
| Tab | Moves through search, available checkboxes, and clear selection. |
| Escape | Closes the disclosure and returns focus to its summary. |
<fieldset class="rs-multi-select"><legend class="rs-multi-select-legend">Cities</legend><details><summary class="rs-multi-select-trigger">Select options</summary><div class="rs-multi-select-panel"><label class="rs-multi-select-option"><input type="checkbox" name="cities" value="alkmaar" /> Alkmaar</label><label class="rs-multi-select-option"><input type="checkbox" name="cities" value="bergen" /> Bergen</label></div></details></fieldset>