Select

A neumorphic select component that displays a list of options for the user to pick from, built on top of Base UI.

Installation

$ npx shadcn@latest add "/r/select.json"

Usage

Examples

Sizes

The select component is available in three sizes: sm, md, and lg.

Props

Select

PropTypeDefaultDescription
size"sm" | "md" | "lg""md"The size of the select trigger.
items{ value: string; label: string }[]-Array of items for value-to-label mapping. Required for displaying labels in the trigger.
defaultValuestring-The default value of the select.
valuestring-The controlled value of the select.
onValueChange(value: string) => void-Event handler called when the value changes.
openboolean-The controlled open state of the select.
onOpenChange(open: boolean) => void-Event handler called when the open state changes.
disabledbooleanfalseWhether the select is disabled.

SelectTrigger

PropTypeDefaultDescription
classNamestring-Additional CSS classes to apply to the trigger.

SelectContent

PropTypeDefaultDescription
classNamestring-Additional CSS classes to apply to the content.

SelectItem

PropTypeDefaultDescription
valuestring-The value of the item.
disabledbooleanfalseWhether the item is disabled.
classNamestring-Additional CSS classes to apply to the item.