Textarea

Multi-line companion to Input with the same label, error shake and message API plus a description line, auto-growing between minRows and maxRows through a measured height transition before it scrolls behind a thin themed scrollbar, and an optional maxLength counter that shifts to warning then destructive near the limit and shakes when a keystroke or paste is refused.

Preview

Textarea preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/textarea
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

label?
string
—
description?
string

Helper text under the label, linked through aria-describedby.

—
value?
string
—
defaultValue?
string
—
onChange?
((value: string) => void)
—
error?
string | boolean

Truthy error triggers a shake, red border and (if a string) a message.

—
minRows?
number

Rows shown when empty; the field never shrinks below this.

3
maxRows?
number

Rows the field grows to before it starts scrolling.

8
showCount?
boolean

Shows the character counter. Defaults to true when `maxLength` is set.

—
warnAt?
number

Fraction of `maxLength` at which the counter turns to the warning color.

0.9
className?
string
—
classNames?
TextareaClassNames
—

Updated