Search documentation

Search the documentation and open a page.

Displays a list of options for the user to pick from, triggered by a button.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/select

Composition

Select ├── SelectLabel (optional) ├── SelectControl │ ├── SelectTrigger │ │ ├── SelectValue │ │ └── SelectIndicator │ └── SelectClearTrigger (optional) ├── SelectPositioner │ └── SelectContent │ ├── SelectItemGroup │ │ ├── SelectItemGroupLabel │ │ └── SelectItem │ │ ├── SelectItemText │ │ └── SelectItemIndicator │ └── SelectSeparator (optional) └── SelectHiddenSelect

Examples

Controlled

Loading...

Default

Loading...

Disabled

Loading...

Groups

Loading...

Invalid State

Loading...

List

Loading...

Long List

Loading...

Multiple Selection

Loading...

Sizes

Loading...

With Icons

Loading...

API Reference

Select

PropTypeDefaultDescription
idstring | undefined—Unique identifier used to connect the component parts.
translationsIntlTranslations | undefined—Configures translations.
idsElementIds | undefined—Overrides generated identifiers for individual parts.
namestring | undefined—Name used when submitting the value with a form.
formstring | undefined—Associates the control with a form by ID.
autoCompletestring | undefined—Configures auto complete.
disabledboolean | undefinedfalseDisables interaction with the component.
invalidboolean | undefined—Marks the associated form control as invalid.
readOnlyboolean | undefinedfalsePrevents changes while preserving focus and navigation.
requiredboolean | undefinedfalseMarks the associated form control as required.
closeOnSelectboolean | undefinedtrueConfigures close on select.
onSelect((details: SelectionDetails) => void) | undefined—Runs when select changes.
onHighlightChange((details: HighlightChangeDetails<T>) => void) | undefined—Runs when highlight changes.
onValueChange((details: ValueChangeDetails<T>) => void) | undefined—Runs when value changes.
onOpenChange((details: OpenChangeDetails) => void) | undefined—Runs when open changes.
positioningPositioningOptions | undefined—Configures floating-element placement and collision handling.
valuestring[] | undefined—Current value when the component is controlled.
defaultValuestring[] | undefined—Initial value when the component is uncontrolled.
highlightedValuestring | null | undefined—Configures highlighted value.
defaultHighlightedValuestring | null | undefined—Configures default highlighted value.
loopFocusboolean | undefined—Configures loop focus.
multipleboolean | undefinedfalseAllows more than one value to be selected or expanded.
openboolean | undefined—Whether the component is open when controlled.
defaultOpenboolean | undefined—Initial open state when uncontrolled.
scrollToIndexFn((details: ScrollToIndexDetails) => void) | undefined—Configures scroll to index fn.
compositeboolean | undefined—Configures composite.
deselectableboolean | undefined—Configures deselectable.

Context, Hooks, and Types

ExportAPI
SelectContextRender-prop component that exposes component state and actions.
SelectRootProviderProvides an externally created API to the component tree.
useSelectCreates or accesses the component API.
useSelectContextReturns the nearest component API.
SelectValueChangeDetailsType for the details object passed to the matching change callback.

Utilities and Supporting Types

ExportAPI
createListCollectionCreates the typed collection consumed by the component.
CollectionItemSupporting type or utility exported with the component.
ListCollectionSupporting type or utility exported with the component.