Web · Components
Textarea
Multi-line text input.
2 exports
Live example
Preview
Code
Events
- Events appear here when you interact with the preview.
Import
Multi-line text input. Supports all native <textarea> props. When the content overflows it uses a scrollbar that takes no width and appears only while scrolling (see ScrollArea).
Examples
TextareaProps
interfaceProps of the Textarea component.
Extends: ComponentProps<"textarea">
| Name | Type | Default | Description |
|---|---|---|---|
autoResize? | boolean | false | If true, the height grows with the content automatically. Uses no JavaScript; works with CSS field-sizing: content. In unsupporting browsers it falls back to a normal (manually resized) field. For an upper limit pass a max-h-* class. |
containerClassName? | string | Classes of the container wrapping the field. The container carries the scrollbar; put layout classes here if needed (e.g. flex-1, w-64). | |
variant? | FieldVariant | CustomVariant<"field"> | Look: outline (bordered), filled, underline or ghost (plain). If omitted, the setting of the nearest data-field-variant container is used, otherwise outline. See FieldVariant. | |
effect? | EffectProp | Effect or effects of the field box (e.g. "glow", ["lift", "beam"]). The accent color is the focus color (--ui-field-focus). If omitted, UIProvider appearance.defaults.field.effect. See BuiltinEffect. |