Textarea: States
Disabled, read-only and invalid. Invalid textareas shake when a form submit fails.
This adds the example as components/examples/textarea/states.tsx, together with the Textarea component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/textarea-states.jsonTo add only the component, follow the Textarea installation.
Props in this example
The Textarea props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
minRows | number | 3 |
Every prop is in the Textarea API reference.
See them all, with keyboard support and accessibility notes, on the Textarea 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.
- useAutosizeGrows a textarea with what you write between its minimum and maximum height, animating each change without ever touching the text.
- 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.