Textarea
Multi-line text input matching the Input API — label, hint, error, resize control, and three sizes.
Import
tsx
import { Textarea } from '@velocityuikit/velocityui'Preview
Briefly describe yourself.
This field is required.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | Label rendered above the textarea. |
| size | 'sm' | 'md' | 'lg' | 'md' | Controls padding and font size. |
| error | string | — | Error message below the field. Sets aria-invalid. |
| hint | string | — | Helper text shown when there is no error. |
| resize | 'none' | 'vertical' | 'horizontal' | 'both' | 'vertical' | CSS resize behaviour. |
| required | boolean | false | Marks the field as required with a visual asterisk. |
| fullWidth | boolean | false | Makes the wrapper fill its container. |
Examples
Basic
tsx
import { Textarea } from '@velocityuikit/velocityui'
export default function Example() {
return <Textarea label="Message" placeholder="Write your message here..." rows={4} />
}With error
tsx
import { Textarea } from '@velocityuikit/velocityui'
export default function Example() {
return (
<Textarea
label="Bio"
error="Bio must be at least 20 characters."
defaultValue="Too short"
/>
)
}No resize
tsx
import { Textarea } from '@velocityuikit/velocityui'
export default function Example() {
return <Textarea label="Fixed height" resize="none" rows={3} />
}Theming
Apply a named theme class to <body> or any parent element. All VelocityUI components inside that element will automatically adopt its colors, shadows, and effects. Combine with a density modifier for complete control:
css
/* Pick any named theme */
<body class="vui-theme-ocean">
/* Add a density modifier (optional) */
<body class="vui-theme-midnight vui-density-compact">
<body class="vui-theme-construction vui-density-spacious">
/* Available themes */
/* default midnight ocean tangerine */
/* construction glass soft high-contrast monochrome-red */
/* Available densities */
/* vui-density-compact vui-density-comfortable vui-density-spacious */