Skip to content
GitHub (opens in a new tab)

Textarea

Multi-line text entry for notes and descriptions. Wrap with Field.

stableAtomcontracts/textarea.json

Preview

Textarea

Multi-line text in lg, md, and sm. Field label sits on top or start (left). Not Input.

Master

Medium size, label on top, with a hint. Wrap with Field. Do not add start slots. Variants shows sizes, a start label and an error.

Keep it under 240 characters

Usage

Wrap with Field. Use Input for a single line. Size sets padding and min-height.

Do's

  • Paragraphs, notes, or descriptions
  • Inside Field when label, hint, or error are required

Don'ts

  • Single-line values — use Input
  • One-time code — use InputOTP
  • Rich text or markdown editing — out of scope
<Field label="Notes" htmlFor="notes" hint="Keep it under 240 characters">
  <Textarea
    id="notes"
    size="md"
    placeholder="Add a note..."
  />
</Field>

When to use

  • Paragraphs, notes, or descriptions
  • Inside Field when label, hint, or error are required

When not to use

  • Single-line values — use Input
  • One-time code — use InputOTP
  • Rich text or markdown editing — out of scope

What an agent reads

import { Textarea } from "agentic-ds-kit";
must
  • Must have associated label via Field
  • aria-invalid when error
  • Disabled uses native disabled and does not resize
defaults
  • size md
  • disabled false
  • error false
stops if
  • Do not invent local Textarea
  • Do not bake Field label or hint into Textarea — wrap with Field
  • Do not add start/icon slots — those are Input
  • Do not use raw hex

From contracts/textarea.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
describedBystringNo—Id(s) for aria-describedby on the textarea. Field passes its hint or error id.
idstringYes——
sizesm | md | lgNomd—
rowsnumberNo—optional native rows; height also comes from size
placeholderstringNo——
disabledbooleanNofalse—
errorbooleanNofalse—
defaultValuestringNo——
valuestringNo—controlled. When set, do not also rely on defaultValue.
onChangefunctionNo—(value: string) => void
namestringNo——
demohover | focusNo—playground only
  • Component
    →

    Input

    Single-line text entry for forms and filters.

  • Component
    →

    InputOTP

    One-time code / PIN as separate slots.