Textarea
A multi-line text field for longer text entry.
Usage
Textarea is the multi-line counterpart to Input, sharing its appearance, variants, and sizes. Use it like a native <textarea> — native attributes pass straight through — and give it a label with an external <label htmlFor> or an aria-label.
rows seeds the initial height (and the resize floor); the field can still be dragged taller by the resize handle. Add adornments with startSlot / endSlot and a clear button with clearable.
Examples
Variants
variant switches the appearance between a bordered outline (default) and a filled soft field.
Sizes
inputSize scales the padding and text — sm, md (default), or lg. (It's named inputSize so it doesn't collide with any native attribute.)
Start & end slots
startSlot and endSlot take any node — not just icons — aligned to the first line of the field. Use them to build a compact composer: an Avatar with a send Button, or a live character counter.
Clearable
Set clearable to add a clear (✕) button that appears once the field has a value and empties it on click. Pair it with onClear to react to the reset.
Disabled, read-only & error states
disabled greys out the field and blocks interaction; readOnly keeps it focusable and selectable but prevents edits. Set aria-invalid to paint the error state — it's mirrored to data-invalid.
RTL
Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.
The text aligns to the start edge, the startSlot/endSlot adornments swap sides, and the resize handle moves to the start corner to follow the resolved direction. For setup details and caveats, see the RTL guide.
API reference
The variant, inputSize, clearable, startSlot, endSlot, and onClear props are Appica additions; every other prop is forwarded to the underlying <textarea>.
Textarea is a native <textarea> styled with the shared input appearance, and forwards every remaining native <textarea> prop (name, onChange, maxLength, aria-*, …). It exposes data-disabled / data-invalid for styling.
Accessibility
- Renders a native
<textarea>(role="textbox", multiline). Give it an accessible name — an external<label htmlFor>pointing at itsid, or anaria-label. - The clear button is labelled Clear input, kept out of the tab order (
tabIndex={-1}), and appears only when the field has a value. aria-invalidis bridged todata-invalidso the error state styles correctly.disabledremoves the field from the tab order and exposesdata-disabledfor styling.