Native select: Invalid
Set aria-invalid and link the message with aria-describedby.
We don't ship to the selected region yet.
This adds the example as components/examples/native-select/invalid.tsx, together with the Native select component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/native-select-invalid.jsonTo add only the component, follow the Native select installation.
Props in this example
The Native select props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
classNameApplied to the wrapper, so it sizes the whole control. | string | – |
Every prop is in the Native select API reference.
See them all, with keyboard support and accessibility notes, on the Native select page.
- InputA text input with three sizes, invalid and read-only states, native validation styling and a 16px touch font so phones never zoom in.
- useComposedRefKeeps a ref to your own element while still forwarding it to whatever ref the parent passed in.
- useInvalidShakeShakes a form control when a submit attempt finds it invalid, and never while someone is still typing.
- CalendarA date grid for single, range and multiple selection, with sliding months, range previews and touch-sized days.
- CheckboxA checkbox whose check draws in, with indeterminate parents, groups and labels that share its hover.
- ComboboxA filterable select with chips, groups and async results, in a popup that resizes as you type.