formsstable

Select

Composable single and multiple selection with search, groups, and virtualization.

Documentation
Preview
Live
Choose one option.
Size
Color
Variant
Options

Usage

Import the component and configure it with the same props used in the playground.

tsx

Examples

Common patterns and practical usage examples.

Basic

Basic component usage.

Choose one option.
tsx

Searchable

Filter options by typing a search query.

Choose one option.
tsx

Multiple

Select more than one option.

Choose one option.
tsx

Error

Validation error state.

Choose one option.
tsx

Disabled

Disabled select state.

Choose one option.
tsx

Loading

Loading state while options are being resolved.

Choose one option.
tsx

API

Props available for the React Select.

76 props

Select

PropTypeDefaultDescription
required
booleanfalseMarks the field and compatible child controls as required.
disabled
booleanfalseDisables the field and compatible child controls.
multiple
booleanfalseEnables multiple selection when true.
placeholder
string'Select...'Placeholder shown when no value is selected.
size
'sm' | 'md' | 'lg''md'Controls the overall select size.
color
'primary' | 'neutral' | 'success' | 'warning' | 'danger''primary'Semantic color palette for the control.
variant
'outline' | 'filled' | 'soft''outline'Visual variant for the select trigger.
invalid
booleanfalseShows invalid styling without requiring error text.
loading
booleanfalseShows the select in a loading state.
clearable
booleanfalseShows a clear action when the select has a value.
searchable
booleanfalseEnables option filtering through a search field.
maxSelected
number-Maximum number of values that can be selected.
closeOnSelect
booleanfalseControls whether the overlay closes after selecting an option.
virtual
boolean | SelectVirtualConfig-Enables virtualization for large option collections.
avoidCollisions
booleantrueAdjusts floating content placement to avoid viewport collisions.
modal
booleanfalseUses modal interaction semantics for the overlay.
command
booleanfalseEnables command-style interaction behavior.
children
ReactNode-Custom option elements rendered inside the select.
label
ReactNode-Visible field label.
description
ReactNode-Supporting text linked to the control.
id
string-Unique id applied to the select trigger.
name
string-Form field name submitted with the selected value.
aria-label
string-Accessible name for the select trigger when no visible label is used.
aria-describedby
string-Ids of elements that describe the select trigger.
aria-labelledby
string-Ids of elements that label the select trigger.
error
ReactNode-Error message linked to the control. Also implies invalid state.
empty
ReactNode-Content shown when no options match the current query.
loadingText
ReactNode-Content shown while options are loading.
placement
'top' | 'right' | 'bottom' | 'left''bottom'Floating content placement relative to the trigger.
matchTriggerWidth
booleantrueMatches dropdown width to the trigger width.
portal
booleantrueRenders dropdown content through a portal.
open
boolean-Controlled open state.
defaultOpen
booleanfalseInitial open state for uncontrolled usage.
onOpenChange
((open: boolean) => void)-Called when the open state changes.
onSearch
((value: string) => void)-Called when the search query changes.
onClear
(() => void)-Called when the clear action is activated.
startIcon
ReactNode-Icon rendered before the selected value.
endIcon
ReactNode-Icon rendered after the selected value.
prefix
ReactNode-Content rendered before the trigger value.
suffix
ReactNode-Content rendered after the trigger value.
renderValue
((context: SelectRenderValueContext) => ReactNode)-Custom renderer for the trigger value.
renderOption
((context: SelectRenderOptionContext) => ReactNode)-Custom renderer for each dropdown option.
onBlur
FocusEventHandler<HTMLButtonElement>-Called when the select trigger loses focus.
onFocus
FocusEventHandler<HTMLButtonElement>-Called when the select trigger receives focus.
className
string-Class name applied to the root element.
triggerClassName
string-Class name applied to the trigger element.
dropdownClassName
string-Class name applied to the dropdown element.
value
string | import("@vellira-ui/types").SelectMultipleValue | null-Controlled selected value or values.
defaultValue
string | import("@vellira-ui/types").SelectMultipleValue | null-Initial selected value or values for uncontrolled usage.
onValueChange
((value: string | null) => void) | ((value: import("@vellira-ui/types").SelectMultipleValue) => void)-Called when the selected value or values change.

Select.Item

PropTypeDefaultDescription
valueRequired
string-Controlled selected value or values.
children
ReactNode-Option label or custom option content.
asChild
boolean-Composes item behavior onto a single child element.
label
string-Text label used when children are custom content.
disabled
booleanfalseDisables selection for this option.
description
ReactNode-Supporting text shown with the option.
icon
ReactNode-Icon shown before the option label.
badge
ReactNode-Badge content shown after the option label.
shortcut
string-Keyboard shortcut hint shown after the option label.
color
'primary' | 'neutral' | 'success' | 'warning' | 'danger''primary'Semantic color palette for the option.

Select.Trigger

PropTypeDefaultDescription
children
ReactNode-Custom trigger content.
className
string-Class name applied to the trigger element.

Select.Value

PropTypeDefaultDescription
children
ReactNode-Custom value content; defaults to the current selected value text.
className
string-Class name applied to the value wrapper.

Select.Content

PropTypeDefaultDescription
children
ReactNode-Custom dropdown content slots.
className
string-Class name applied to the dropdown content.

Select.Search

PropTypeDefaultDescription
placeholder
string'Select...'Placeholder shown in the search input.
className
string-Class name applied to the search input.

Select.Group

PropTypeDefaultDescription
children
ReactNode-Option items rendered inside the group.
labelRequired
ReactNode-Visible group label.
selectable
boolean-Allows selecting all options in the group from the group header.
selectLabel
ReactNode-Accessible label for the group-level select action.

Select.Label

PropTypeDefaultDescription
children
ReactNode-Label content for a select group.

Select.Separator

PropTypeDefaultDescription
children
undefined-Select separators do not render children.

Select.Empty

PropTypeDefaultDescription
children
ReactNode-Empty state content shown when no options match.

Select.Loading

PropTypeDefaultDescription
children
ReactNode-Loading state content shown while options are loading.

Accessibility

Guidance for accessible usage and interaction.

Accessible naming

Provide a visible label or another accessible name for the select trigger.
labeldescription

Keyboard interaction

Preserve expected keyboard navigation, focus management, and option selection behavior.
opendefaultOpensearchable

Selection state

Keep selected values and expanded state synchronized with the visual interface.
valuedefaultValuemultiple

Validation feedback

Associate validation feedback with the control and expose invalid and required state.
errorinvalidrequireddisabled

Related components

Explore components that are commonly used alongside this one.