Components · Form & Input
Textarea
StableAdded v0.0.1
A multi-line text input with configurable resize behaviour, size, and validation states.
import { Textarea } from '@nexub/react';Playground
Props
size
resize
<Textarea placeholder="Enter your message…" />Examples
Default
Sizes
Invalid
States
defaultdisabledinvalidsize="sm"size="md"size="lg"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| placeholder | string | — | Placeholder text shown when the field is empty. |
| disabled | boolean | — | Disables the textarea. |
| invalid | boolean | — | Applies error styling to indicate a validation failure. |
| rows | number | — | Initial visible row count. |
| resize | 'horizontal' | 'vertical' | 'none' | 'both' | 'vertical' | Controls resize handle visibility. |
| size | 'sm' | 'md' | 'lg' | 'md' | Controls font size and padding. |
| autoGrow | boolean | false |
Design tokens
Textarea reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Textarea below it, and leave the roles other components share alone. See the three token tiers.
Input, Textarea, Select and Combobox triggers.
| Token | Aliases | Notes |
|---|---|---|
| --field-bg | --color-surface-container-lowest | — |
| --field-fg | --color-on-surface | — |
| --field-border | --color-outline | — |
| --field-radius | --shape-field | — |
/* One area of your app */
.checkout {
--field-bg: var(--color-secondary);
}On iOS & Android
Web only
Textarea has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.