HextaUI

Textarea: Fixed size

autoResize={false} keeps a fixed height with a vertical resize handle.

import { Textarea } from "@/components/ui/textarea"

export function TextareaFixed() {
  return (
    <Textarea
      aria-label="Notes"
      autoResize={false}
      minRows={4}
      placeholder="Fixed height. Drag the corner to resize."
      className="max-w-sm"
    />
  )
}

This adds the example as components/examples/textarea/fixed.tsx, together with the Textarea component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/textarea-fixed.json

To add only the component, follow the Textarea installation.

Props in this example

The Textarea props this example sets, from the API reference.

PropTypeDefault
autoResizeGrow with the text instead of a fixed height.
booleantrue
minRows
number3

Every prop is in the Textarea API reference.

See them all, with keyboard support and accessibility notes, on the Textarea page.