TextArea
Terminal-style multi-line text input with custom caret.
Import
Basic Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Label text for the textarea |
rows | number | 4 | Number of visible rows |
caretChars | string | ' ' | Custom caret character |
isBlink | boolean | true | Whether the caret should blink |
value | string | — | Controlled value |
defaultValue | string | — | Default value for uncontrolled mode |
placeholder | string | — | Placeholder text |
disabled | boolean | false | Whether the textarea is disabled |
readOnly | boolean | false | Whether the textarea is read-only |
maxLength | number | — | Maximum character length |
onChange | (event: ChangeEvent) => void | — | Change event handler |
onFocus | (event: FocusEvent) => void | — | Focus event handler |
onBlur | (event: FocusEvent) => void | — | Blur event handler |
className | string | — | Additional CSS class names |
ref | React.Ref<HTMLTextAreaElement> | — | Forwarded ref to the textarea element |
All standard HTML textarea attributes are also supported.
With Label
Row Heights
Control the visible height with the rows prop:
With Placeholder
Custom Caret
States
Controlled with Character Count
Accessibility
- Semantic
<textarea>element with proper labeling - Supports all standard textarea attributes
- Keyboard accessible with visible focus states
- Works with screen readers
Styling
| Variable | Description |
|---|---|
--theme-border | Textarea border color |
--theme-background | Textarea background color |
--theme-text | Textarea text color |
--theme-focused-border | Border color when focused |