useAutosize: Controlled values
Typing fires input, but setting value from code doesn't. Pass the value as the third argument and the textarea refits when you insert a template or clear it.
This adds the example as components/examples/use-autosize/controlled.tsx, together with the useAutosize component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/use-autosize-controlled.jsonTo add only the component, follow the useAutosize installation.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- InputA text input with three sizes, invalid and read-only states, native validation styling and a 16px touch font so phones never zoom in.
- Input groupAn input with icons, text, buttons or a keyboard hint attached, sharing one border and focus ring.
- TextareaMulti-line text that grows smoothly with what you write between a minimum and maximum number of rows, with counters, validation and a submit shortcut.