Select previewSelect preview

Select

Single-choice select with a popup list, typeahead, groups, descriptions, icons and optional search; behavior from Vercel's UI SDK, styled on the foundation tokens.

  • Group
    Selects
  • Origin
    Adapted · UI SDK (Vercel) · source
  • License
    Apache-2.0
  • Added
    Nov 12

Install

npx shadcn@latest add @deank/select

Needs the @deank registry in components.json once:

{
  "registries": {
    "@deank": "https://system.say.ventures/r/{name}.json"
  }
}

Or skip the setup and install from the URL:

npx shadcn@latest add https://system.say.ventures/r/select.json

The first install also adds the shared tokens. Import them once in your root layout or it renders unstyled:

import "@/registry/foundation.css";

Usage

import { Select } from "@/registry/components/select/select";

<Select label="…" options={[/* … */]} />

Props

PropTypeDefaultDescription
labelstringVisible label; pressing it focuses the trigger like a native select
options(SelectOption | SelectOptionGroup | string)[]Plain strings, option objects, or labelled groups
value?string | nullControlled value; null means nothing chosen
defaultValue?string | nullStarting value when uncontrolled
onValueChange?(value: string | null) => voidCalled with the new value, or null when cleared
placeholder?string"Select…"Shown in the trigger while nothing is chosen
searchable?booleanfalseAdds a search field above the list; matches are highlighted
emptyText?string"No matches"Text when the search finds nothing
name?stringHidden input name, so the value submits with a form
required?booleanBlocks form submission until a value is chosen; shows an asterisk
disabled?booleanNot focusable, not submitted
size?"sm" | "md" | "lg""md"Trigger height: 32, 40 or 48px
defaultOpen?booleanOpens the list on mount (demos, onboarding)
width?number | stringSets the trigger width; the popup is at least as wide
className?stringClass on the wrapping field

When to use

  • Picking one value from a list of about 5 to 200 options in a form or settings row: role, region, plan, timezone
  • Long lists where people know what they want: turn on `searchable` to filter and highlight matches
  • Options that need a second line or an icon

When not to use

Two to four always-visible choices (segmented-control); several values at once (filter-menu); a list of actions rather than a value (goo-dropdown or profile-menu); a command search across the app (command-palette).

Related

Text field · Filter menu · Segmented control · Goo dropdown · Settings panel