Primitives

Multi select

Chips in the field, search, groups, select all; ↑ ↓ Enter, Backspace removes the last; max says why it stops.

Grouped by city; type to search; Backspace removes the last.

max stops the fourth choice and says why.

Import#

Everything comes from the package root. The example above uses:

your-component.tsx
import { FormField, MultiSelect, type MultiSelectOption } from "@waveinno/ui";

Props#

Read from the source of this version, so they match the code exactly.

<MultiSelect>

src/components/ui/multi-select.tsx
PropTypeDefaultDescription
optionsrequiredMultiSelectOption[]—
valuestring[]—
defaultValuestring[][]
onValueChange(value: string[]) => void—
placeholderstring"Choose…"
maxShownnumber3Chips shown in the field before "+N". Default 3.
maxnumber—
bulkbooleantrueOffer "Select all" and "Clear" under the list. Default true.
disabledboolean—
stateInputState"default"
labelsPartial<Record<"search" | "empty" | "selectAll" | "clear" | "selected" | "limit" | "remove", string>>—
aria-labelstring—
classNamestring—

<FormField>

src/components/ui/form-field.tsx
PropTypeDefaultDescription
labelReact.ReactNode—
htmlForstring—The control's id, so clicking the label focuses it.
requiredboolean—
hintReact.ReactNode—
errorReact.ReactNode—
warningReact.ReactNode—
successReact.ReactNode—
count{ value: number; max: number }—Character counter, e.g. { value: note.length, max: 240 }.
classNamestring—
childrenrequiredReact.ReactNode—

Install#

If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.

$ npm install @waveinno/ui