Textarea v0.1.0 Forms

Multi-line text input with label, description, and error wiring (mirrors TextField).

import { Textarea } from "latticeui-react";

Examples

Basic

Markdown is supported.

Show code
<Textarea
  label="Feedback"
  rows={4}
  placeholder="Tell us what you think..."
  description="Markdown is supported."
/>

With error

Show code
<Textarea label="Bio" error="Bio is required." rows={3} />

Anatomy

These data-part attributes are a versioned public API - style and test against them; they will not change in a minor release.

PartElementStable selector
rootdiv[data-scope="textarea"][data-part="root"]
labellabel[data-scope="textarea"][data-part="label"]
inputtextarea[data-scope="textarea"][data-part="input"]
descriptionp[data-scope="textarea"][data-part="description"]
errorp[data-scope="textarea"][data-part="error"]

Props

PropTypeDefaultDescription
label *string
descriptionstring
errorstring
...restReact.TextareaHTMLAttributes<HTMLTextAreaElement>

Accessibility

Roles: textbox (native)

Styling

Override styles by targeting the stable selectors below from any unlayered CSS - it always beats the library's @layer latticeui styles, no !important needed.

[data-scope="textarea"][data-part="input"] {
  /* your overrides */
}

State attributes: data-invalid