Native select: Field
Inside a <Field />, the label and description connect on their own and errors show as the value changes. Submit without a plan and the select turns red, shakes once, and the browser points to it.
This adds the example as components/examples/native-select/field.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-field.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 | – |
required | boolean | false |
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.