Components/Forms
Multi-line field that grows with its content and counts characters.
Goes straight to the team. We read every one.
Installation#
npx shadcn@latest add https://get-neonkit.vercel.app/r/textarea.jsonUsage#
import { Textarea } from "@/components/ui/textarea"
<Textarea label="Feedback" maxLength={280} showCount />Examples#
Auto-resize
The field grows with its content between minRows and maxRows, then scrolls.
Grows with each line up to 8, then scrolls.
Character limit
With maxLength, the count turns amber in the last 10% and red at the limit.
Shown on your public profile.
Error and disabled
Major releases need release notes before they can ship.
Generated from the merge commit.
API reference#
Textarea
Also accepts every native textarea attribute, and the ref points at the <textarea>. className and style go to the field box around it.
| Prop | Type | Default |
|---|---|---|
label | ReactNodeVisible label, linked to the textarea. | — |
description | ReactNodeHelper text under the field. | — |
error | ReactNodeRed invalid state and message. Replaces description. Pass true for the state without a message. | — |
autoResize | booleanGrow with the content. When off, rows applies and the field resizes by hand. | true |
minRows | numberStarting height in lines. | 3 |
maxRows | numberHeight in lines before the field scrolls. | 10 |
showCount | booleanCharacter count in the corner, as count / maxLength when maxLength is set. | false |
color | NeonColorPalette name or hex. Falls back to --neon-accent, then cyan. | inherited |
size | "sm" | "md" | "lg"Padding, text size and line height. | "md" |
className | stringClasses for the field box: border, background, radius. | — |
containerClassName | stringClasses for the outer block with the label and message. | — |
Accessibility#
- The count is linked with aria-describedby, so screen readers read it when the field gets focus.
- maxLength is the native attribute, so typing and pasting stop at the limit.
- Auto-resize re-measures when the value changes and when the field's width changes.