ComboBox
ComboBox — Prism component.
Signature
Density
Viewport
Theme follows the navbar ☀/☾ toggleWhen to use
- Use it when Pick from a long list with type-ahead, or allow multiple selections.
- Reach for something else when A handful of options where a plain
Selectis simpler.
Accessibility
Always render a visible <label> (the label prop wires htmlFor/id for you). Errors set aria-invalid and are announced via aria-describedby. Required fields expose aria-required.
Import
const { ComboBox } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | — | |
description | string | — | |
items | (string | ComboBoxItem)[] | Yes | Options as strings or { value, label } objects. |
selectionMode | "single" | "multiple" | — | "single" (default) fills the input; "multiple" shows removable chips. |
defaultValue | string | — | |
defaultSelectedKeys | string[] | — | Pre-selected values (multiple mode). |
selectedKeys | string[] | — | Controlled selected values (multiple mode). |
onSelectionChange | (values: string[]) => void | — | Fired in multiple mode with the full selected value array. |
placeholder | string | — | |
onSelect | (value: string, item: ComboBoxItem | null) => void | — | |
allowsCustomValue | boolean | — | Allow free text that isn't in the list. |
isDisabled | boolean | — | |
id | string | — | |
className | string | — |