Select
React componentChoose an option from a rounded, optionally grouped list.
Try it out
Use the live controls or open the Code tab to view and copy the example.
API reference
Generated from the package’s TypeScript exports. Standard React event and ARIA attributes are also accepted where the component wraps a native element.
| Prop | Type | Description |
|---|---|---|
optionsRequired | SelectOption[] | Selectable values with stable unique identifiers. |
placeholder | string | undefined | Standard React / HTML attribute passed to the underlying element. |
onValueChange | ((value: string) => void) | undefined | Called with the next value. Update controlled state here. |
autoComplete | string | undefined | Standard React / HTML attribute passed to the underlying element. |
disabled | boolean | undefined | Disables interaction (or date matchers for DatePicker). |
name | string | undefined | Field name used in form submission. |
required | boolean | undefined | Participates in native form validation. |
value | string | number | readonly string[] | undefined | Controlled value. Pair with its change callback. |
onChange | ChangeEventHandler<HTMLSelectElement, HTMLSelectElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
defaultChecked | boolean | undefined | Standard React / HTML attribute passed to the underlying element. |
defaultValue | string | number | readonly string[] | undefined | Initial value for uncontrolled usage. |
className | string | undefined | Additional CSS class names. |
id | string | undefined | Standard React / HTML attribute passed to the underlying element. |
style | CSSProperties | undefined | Inline styles, including CSS custom property overrides. |
rel | string | undefined | Standard React / HTML attribute passed to the underlying element. |
children | ReactNode | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLSelectElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onBlur | FocusEventHandler<HTMLSelectElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onError | ReactEventHandler<HTMLSelectElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
onClick | MouseEventHandler<HTMLSelectElement> | undefined | Standard React / HTML attribute passed to the underlying element. |
labelRequired | string | A meaningful visible or accessible label. |
description | string | undefined | Supporting instructions associated with the control. |
error | string | undefined | Validation message; also sets aria-invalid. |
hideLabel | boolean | undefined | See the typed definition and working example for this option. |
Accessibility & interaction
Use a persistent visible label and provide textual errors; native controls support keyboard input and browser form constraints.
Visible focus, reduced motion, and both color themes are shared across staqui. Choose labels and document structure that make sense in your application; automated checks do not replace assistive-technology testing.
Variants & implementation notes
Single-select options can include descriptions. The selected option shows a checkmark. Multiple selection and listbox sizing use the native control.
Use the typed API above for the supported variants. The example demonstrates the primary composition; shared controls inherit hover, focus, active and disabled treatment where applicable.