Select

A custom dropdown with search, groups, clearing, and full keyboard navigation.

Import#

import { Select } from "astralis-ui";

Usage#

Options come in as data — flat { value, label } items or { group, options } sections — and the dropdown portals out of any overflow: hidden ancestor, so it works inside cards and modals.

Searchable, clearable, grouped#

States#

filled variant
loading
invalid
disabled

Props#

PropTypeDefaultDescription
options{ value, label }[] or { group, options }[][]The option data.
value / defaultValue / onChangestring | number | null / same / (value) => void— / null / —Controlled / uncontrolled API.
placeholderstring"Select an option"Trigger text when empty.
searchablebooleanfalseFilter input inside the dropdown.
clearablebooleanfalse× button when a value is selected (also fires onClear).
loadingbooleanfalseSpinner instead of the chevron.
emptyTextstring"No options"Shown when nothing matches.
namestringRenders a hidden input so the value submits with native <form>s.
variant / size"outline" | "filled" / "sm" | "md" | "lg""outline" / "md"Styling.
colorSchemeall 11 schemes"brand"Highlight and focus-ring hue.
invalid / disabled / readOnlybooleanfalseState flags — inherited from Field.

Keyboard#

KeyAction
Enter / SpaceOpen; when open, select the highlighted option
Open when closed; move the highlight down
Move the highlight up
type (with searchable)Filter the options
EscClose and refocus the trigger
TabClose and move on

Accessibility#

  • The trigger is a combobox with aria-haspopup="listbox" and aria-expanded; options carry role="option".
  • Selecting an option returns focus to the trigger.