Skip to content

Select

Pick one value from a list that opens like a menu.

Base UI1.6 kB gzipSource Registry JSON

Select playground

Props

initial

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/select.json

The CLI writes components/ikada/select.tsx and merges the ikada theme into your CSS. Or take it from the package: import { Select } from "@sproutboat/ikada";

Usage

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

<Select
  aria-label="Region"
  options={regions}
  defaultValue="eu-west"
/>

Examples

Default

Placeholder

Error

Pick a region.

Disabled

Props

SelectProps
PropTypeDescription
optionsrequiredreadonly SelectOption[]The choices, in order: value and label.
placeholderstringShown while nothing is chosen. Default "Select...".
invalidbooleanMarks the trigger invalid: danger ring and aria-invalid.
classNamestringClasses merged onto the root element, after ikada's own.
aria-labelstringAccessible name when there is no Field label.
idstringThe id of the Select.

Also takes every prop of Omit< ComponentProps<typeof BaseSelect.Root<string>>, "children" | "items" | "className" >.

Source: src/components/select.tsx