TextArea
A multi-line text input component with support for labels, validation states, resizing, and various visual styles.
Import
Usage
Examples
Color
Variant
Size
Radius
With label
With description
Please provide your feedback in detail
Rows
Validation states
Please enter a valid description
Valid description
Please review your input
Disabled
Loading state
Required
Custom styling
With default value
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md" | Size scale |
radius | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "full" | "md"* | Corner rounding |
variant | "solid" | "ghost" | "bordered" | "faded" | "underlined" | "bordered"* | Visual style |
color | "none" | "default" | "primary" | "secondary" | "danger" | "warning" | "success" | "primary"* | Semantic color |
status | "default" | "error" | "success" | "warning" | "default" | Validation status |
label | string | None | Field label |
labelAlign | "left" | "top" | "left"* | Label position |
description | string | None | Help text below the field |
message | string | None | Status message |
required | boolean | false | Shows required indicator |
isLoading | boolean | false | Shows loading state |
disabled | boolean | false | Disables interaction |
rows | number | 4* | Number of visible rows |
enableVirtualKeyboard | boolean | true | Enables virtual keyboard on focus |
className | string | None | Extra classes, merged with internal styles |
* Falls back through Global Configuration if not set. See below.
Global Configuration
TextArea reads defaults from four places, in this order of precedence:
- Instance prop: set directly on
<TextArea /> - Component config:
components.textareain yourashee.config - Theme default:
defaultVariant/defaultColor/defaultRadiusin yourashee.config - Built-in fallback: component's internal default values
Component config
Built-in fallbacks
Accessibility
- Renders a native
<textarea>element with proper semantics - Uses
aria-invalidfor error states - Uses
aria-describedbyto associate description and message text - Uses
aria-busyfor loading state - Supports
disabledandrequiredattributes natively - Implements
focus-visiblerings for keyboard navigation - Labels are properly associated with
htmlFor/id
Notes
- Rows: The
rowsprop controls the initial height of the textarea. Users can resize vertically by default. - Status Colors: When
statusis set toerror,success, orwarning, the textarea border reflects the status color. - Underlined Variant: When
variant="underlined", the textarea has no border radius and only a bottom border. - Virtual Keyboard: The
enableVirtualKeyboardprop enables the virtual keyboard integration. Default istrue. - Resizing: The textarea is resizable vertically by default (
resize-y). This can be customized via className.