Skip to Content
ComponentsTextarea

Textarea

Same compound API as Input, but renders a <textarea>. Controlled, uncontrolled, and consumer-controlled error state.

Preview

Anatomy

import { Textarea } from '@wire-ui/react' <Textarea.Root value={value} onChange={setValue}> <Textarea.Label>Message</Textarea.Label> <Textarea.Field placeholder="Write something..." rows={4} /> <Textarea.Error /> </Textarea.Root>

Root props

PropTypeDefaultDescription
valuestringControlled value
defaultValuestring''Initial value for uncontrolled use
onChange(value: string) => voidCalled on every keystroke
onFocus() => voidCalled on focus
onBlur() => voidCalled on blur
invalidTypestring''Key into errorMessage; consumer-controlled
errorMessageRecord<string, string>{}Map of error keys to display strings
isRequiredbooleanfalseShows * in label; sets aria-required
idstringauto-generatedLinks label to field

Field props

All standard <textarea> HTML attributes are supported on Textarea.Field (rows, cols, maxLength, etc.).

Field data attributes

AttributeWhen present
data-activeField is focused
data-invalidinvalidType is non-empty
Last updated on

MIT License © 2026 wire-ui