Select

Installation

$npx shadcn-macos@latest add select

Examples

Props

<Select />
PropTypeDefaultDescription
options*{ value: string; label: string; disabled?: boolean }[]—List of options available in the select dropdown.
valuestring—Controlled selected option value.
defaultValuestring—Initial selected value when uncontrolled.
onChange(value: string) => void—Callback invoked when a new option is picked.
placeholderstring"Select an option..."Placeholder text displayed when no value is selected.
disabledbooleanfalseWhether the select dropdown is disabled.
classNamestring—Custom CSS classes.