Skip to content

Select

const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<SelectHandle>>;

Dropdown select with keyboard navigation, type-to-filter, and scrolling.

Opens on Space or Enter. Close with Escape or Tab. Type to filter when open (if searchable is enabled).

Automatically detects whether to open upward or downward based on available space, unless you override with openDirection.

const [color, setColor] = useState<string>();
<Select
items={[
{ label: "Red", value: "red" },
{ label: "Green", value: "green" },
{ label: "Blue", value: "blue" },
]}
value={color}
onChange={setColor}
placeholder="Pick a color"
/>
// Force dropdown to always open upward
<Select items={items} value={v} onChange={setV} openDirection="up" />

PropertyTypeDescription
disabled?booleanDisabled state
dropdownStyle?StyleDropdown overlay style overrides
focusedStyle?StyleTrigger style when focused
highlightColor?ColorHighlight color for the selected item in the dropdown (default: “cyan”)
itemsSelectItem[]List of selectable items
maxVisible?numberMax visible items in the dropdown before scrolling (default: 8)
onChange?(value) => voidCallback when selection changes
openDirection?"auto" | "up" | "down"Force dropdown open direction: “up”, “down”, or “auto” (default: “auto”)
placeholder?stringPlaceholder text when nothing is selected
searchable?booleanEnable type-to-filter when dropdown is open (default: true)
style?StyleTrigger box style
value?stringCurrently selected value (controlled)

A single option inside a Select dropdown.

PropertyTypeDescription
disabled?booleanWhen true, the item is dimmed and cannot be selected.
labelstringDisplay text shown in the dropdown.
valuestringValue returned when this item is selected.

Handle for Select — exposes current selected value

blur(): void;

Programmatically blur (unfocus) this element

void

FocusableHandle.blur


focus(): void;

Programmatically focus this element

void

FocusableHandle.focus


scrollIntoView(options?): void;

Scroll the nearest parent ScrollView to make this element visible. Behaves like the DOM Element.scrollIntoView() method. No-op if the element is not inside a ScrollView.

ParameterTypeDescription
options?ScrollIntoViewOptionsAlignment options (default: { block: "nearest" })

void

const inputRef = useRef<InputHandle>(null);
// Minimal scroll — just enough to make it visible
inputRef.current?.scrollIntoView();
// Center the element in the viewport
inputRef.current?.scrollIntoView({ block: "center" });

FocusableHandle.scrollIntoView

PropertyModifierTypeDescriptionInherited from
isFocusedreadonlybooleanWhether this element is currently focusedFocusableHandle.isFocused
isOpenreadonlybooleanWhether the dropdown is currently open-
valuereadonlystring | undefinedCurrently selected value (undefined if nothing selected)-