Ravox KitForms

Select

Select following the WAI-ARIA combobox pattern: arrows, Home/End, Enter, Esc and type-ahead. The list opens on the top layer, so no overflow: hidden clips it. Sends its value with the form through name.

Dá para trocar de plano quando quiser.

Settings

Tamanho
Toggles

Installation

The command creates components/ui/select.tsx in your project and installs the theme with it. The file is yours: edit it as you like.

npx @ravox-ui/cli add select

Props

PropTypeDefaultDescription
options{ value, label, description?, disabled? }[]—The options. The description appears below the label, in the list only.
value / onValueChangestring / (value: string) => void—Controlled mode (and the way to wire it into React Hook Form's Controller).
defaultValuestring—Initial value (uncontrolled mode).
namestring—Creates an <input type="hidden"> with the value, for a plain form.
placeholderstring"Select…"Text while nothing is selected.
label / hint / errorReactNode—Same as Input: wired label, note through aria-describedby, error with aria-invalid.
size"sm" | "md" | "lg""md"Height of the button.
renderValue(option) => ReactNode—How the selected option appears in the button (default: the label).

More in Forms