Textarea
Multiline text field used for comments, notes, and longer form content.
Installation
npx @glass-ui-kit/cli add textareaUsage
Examples
Default
The standard textarea uses the default variant with the medium size.
Sizes
Use the size prop for the standard textarea scale. md is the default. Pair it with native rows when you want more room for content.
Variants
Use variants to change the surface treatment before reaching for custom classes.
Error State
Glass UI textareas do not use an error prop. Set aria-invalid="true" to opt into the built-in destructive border and focus ring.
Please include enough detail for us to reproduce the issue.
Disabled
The disabled state is automatically handled by the component using Tailwind’s native disabled attribute.
Form Composition
Use Field for the canonical label + control + helper text pattern. Textarea remains a native textarea outside that wrapper too.
Keep it brief. You can always edit this later.
Styling
Textarea now follows the same prop-first API direction as Button and Input. Reach for variant and size first, then use className as an escape hatch for one-off layout or state styling.
API Reference
| Prop | Type |
|---|---|
variant | "default" | "soft" | "strong" | "transparent" |
size | "sm" | "md" | "lg" |
className | string |