The Select component allows the user to click and select an item from a list of options.
View source code(value: T) => void
Handler that is called when a option is selected.
(T | OptionGroup<T>)[]
The list of options.
Option
The current value (controlled).
string
className for the element.
string
Maximum height of the dropdown content.
"content" | "parent"
Whether the Select should fit its parent or content.
Default: contentboolean
Enable a search bar inside the dropdown. Field becomes a button trigger.
Default: falseboolean
Whether the Select is disabled.
boolean
Whether the Select is invalid.
string
The name of the Select, used when submitting an HTML form.
FocusEventHandler<HTMLInputElement>
Handler that is called when the element loses focus.
FocusEventHandler<HTMLInputElement>
Handler that is called when the element receives focus.
(value: string) => void
Called when the dropdown search value changes. Consumer should filter options.
string
Temporary text that occupies the Select when it is empty.
"bottom-end" | "bottom-start" | "end-bottom" | "end-top" | "top-end" | "top-start"
Placement the menu will render relative to the field
(rawValue: string) => ReactNode
Render when no options are available; receives the current search value.
(option: T, state?: { isSelected: boolean; isDisabled: boolean; }) => ReactNode
Function to render option. Should return DropdownItem(s).
(optionGroup: OptionGroup<T>) => ReactNode
Function to render option group.
string
The placeholder for the search bar.