Skip to main content

Select

A non-searchable custom picker (styled ListBox). For filter/multi, use ComboBox.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

  • Use it when Choose one option from a known, short-to-medium list.
  • Reach for something else when Searchable or multi-select needs — use ComboBox.

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.

Install and import​

npx shadcn@latest add @prism/select
import { Select } from '@/components/prism/Select';

In a no-build prototype, read it from the bundle instead: const { Select } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
labelReact.ReactNode—Visible label. Without one, set aria-label or aria-labelledby.
descriptionstring—Id of an element that names the field.
errorMessagestring—
isRequiredboolean—
isInvalidboolean—
isDisabledboolean—
items(string | SelectItem | SelectSection)[]—Options as strings or { value, label, isDisabled } objects, optionally grouped as { section, items } (the same shape ComboBox takes).
valuestring | null—Controlled selected value. null = controlled with nothing selected; omit (undefined) for uncontrolled.
defaultValuestring—Uncontrolled initial value.
onSelect(value: string, item: SelectItem) =&gt; void—Fired with the chosen value (and item, when items are objects).
onChange(value: string) =&gt; void—Convenience alias fired with the chosen value.
placeholderstring—
size"sm" | "md"—"sm": the compact trigger for table cells. Default is the standard control height.
namestring—Form field name. When set, the value submits with the enclosing form (via a hidden native select).
formstring—Id of the form to submit with, when the Select sits outside it.
autoCompletestring—Autofill hint for the hidden native select, e.g. "country".
idstring—
childrenReact.ReactNode—Legacy: <option> children are parsed into items when items is omitted.
width"xs" | "sm" | "md" | "lg" | "full"—Maximum width: "xs" (8rem) | "sm" (12rem) | "md" (20rem) | "lg" (36rem) | "full" (default). A cap, not a fixed width — it still shrinks on a phone or in a narrow FormRow column; the label and messages follow it. Sizes are the --field-width-* tokens.
classNamestring—