On this page

InstallationUsageWhere it is usedAnatomyIt grows with its textA height limitResizableStatesIn a FieldBeside an InputKeyboard and screen readersAPI ReferenceTextareaRulesDecidedOpen questionsOther systems

Textarea

More than one line of text a person writes. The Input's look on a box that starts 64px tall and grows with what is typed.

1<Textarea aria-label="System prompt" placeholder="You are a careful assistant." />

Installation

text
import { Textarea } from "@dome-systems/ds-dashboard/components/textarea";

Usage

text
import { Field } from "@dome-systems/ds-dashboard/components";
import { Textarea } from "@dome-systems/ds-dashboard/components/textarea";
text
<Field title="Description" optional>
  <Textarea value={description} onChange={(event) => setDescription(event.target.value)} placeholder="What this agent is for." />
</Field>

Where it is used

In the dashboard today it holds descriptions, notes, prompts, and pasted certificates and JSON. The dashboard's own components/ui/textarea.tsx renders it.

Two things are built on it. Text a managed run receives (a system prompt, a trigger's input) is the dashboard's RunTemplateTextarea: this Textarea under a layer that paints run variables as tokens. The rules assistant's composer is this Textarea with a send button beside it. Cedar rules are not a Textarea: they have their own editor.

Anatomy

123
  1. 1 — Box. The Input's fill, edge and 8px corner. The edge is a shadow, never a CSS border.
  2. 2 — Text. The value, or the placeholder in the muted color, 12px from the sides and 8px from the top and bottom.
  3. 3 — Resize handle. Only with resizable. The browser's own.
Starts atGrowsTextCornerSideTop and bottom
64px (two lines)With its text, no limit13px, 20px lines8px12px8px

It grows with its text

Empty, it is 64px tall, which holds two lines. From the third line it grows a line at a time. It has no size prop: its text is 13px, the Input's at md. Type in the first one to see it.

1<Textarea aria-label="System prompt" placeholder="You are a careful assistant." />2<Textarea aria-label="System prompt" value={prompt} onChange={(event) => setPrompt(event.target.value)} />

A height limit

A max-h-* class caps it. Past the cap it scrolls inside its box. A min-h-* class starts it taller, or shorter.

1<Textarea className="max-h-32" aria-label="System prompt" value={prompt} onChange={(event) => setPrompt(event.target.value)} />

Resizable

resizable shows the browser's handle at the bottom right. It resizes up and down only. Off by default.

1<Textarea resizable aria-label="Certificate" placeholder="Paste the certificate here." />

States

The Input's, on the same tokens: empty with a placeholder, filled, invalid (aria-invalid: a 1px red edge), read-only and disabled. Read-only and disabled share one muted fill; disabled also mutes the text and the edge. Focus adds a 3px band and a 1px line round the edge. Click or Tab into one to see it.

1<Textarea aria-label="Empty" placeholder="Placeholder" />2<Textarea aria-label="Filled" value={prompt} onChange={change} />3<Textarea aria-label="Invalid" aria-invalid value={prompt} onChange={change} />4<Textarea aria-label="Read-only" readOnly value={prompt} />5<Textarea aria-label="Disabled" disabled value={prompt} />

In a Field

The Textarea draws the box and nothing around it. Inside a Field, the Field's title names it, the description and the error are read with it, and an error marks it invalid. Beside its title (a horizontal Field) the title stays at the top of the row.

System prompt

What the agent is told before every run.

Write at least one sentence.
1<Field title="System prompt" description="What the agent is told before every run." error="Write at least one sentence.">2  <Textarea value={prompt} onChange={(event) => setPrompt(event.target.value)} />3</Field>

Beside an Input

The two share one fill, edge, corner, side padding and 13px text.

Name
Description
Optional
1<Field title="Name">2  <Input placeholder="billing-sync" />3</Field>4<Field title="Description" optional>5  <Textarea placeholder="What this agent is for." />6</Field>

Keyboard and screen readers

Its name. A text area has no label of its own. Inside a Field the title names it. Outside one, a screen reader has only what you give it: an aria-label.

Keys. By default Enter adds a line and Tab leaves the box. A screen can change that: the rules assistant's composer sends on Enter.

Invalid, read-only, disabled. aria-invalid draws the red edge; a Field's error sets it and says why. A read-only text area stays in the tab order and can be selected and copied. A disabled one is skipped by Tab.

API Reference

Textarea

One prop of its own. Besides it, every prop of a <textarea> (value, onChange, placeholder, disabled, readOnly, maxLength, aria-invalid…).

PropTypeDefaultDescription
resizablebooleanfalseShows the browser's resize handle at the bottom right, to drag the box taller or shorter.
textRole"body-2" | "body-1""body-2"Its text's role: 13px, or 15px for a box that stands large on a page (the AI composer's compact size).
classNamestring—Where a height limit goes (max-h-32), or another starting height (min-h-32).

Rules

Decided

Description
Optional

Shown on the agent's page.

DoThe Field names it, and reads the help and the error with it.

Its title, help and error are the Field's

Decided with the form controls: no label is laid over a control by hand. A label over a control is the Field's title, and a press on it focuses the control.

One look with the Input

The Textarea takes the Input's fill, edge, focus band and invalid edge from the same tokens. It has no look of its own.

Open questions

Each of these is something another system advises or builds. None is decided for us.

When is it a Textarea, and when an Input?

Open
Ours

Not written down. Screens choose case by case.

Other systems

Atlassian: for shorter text, use the text field.

How tall should it start?

Open
Ours

64px. Screens change it with a min-h-* class today, taller for a prompt and shorter for the assistant's composer.

Other systems

Polaris (its web components): the number of rows shown sets how much people expect to write.

Grow without limit, a fixed height, or a cap?

Open
Ours

It grows with its text. No screen caps a Textarea with max-h-* today, and nothing says when to.

Other systems

Atlassian's grows and shrinks with its content by default. Primer's is resized by hand in both directions by default, with growing as an option.

A placeholder?

Open
Ours

Many text areas show one. No rule says what it should hold.

Other systems

They disagree. Atlassian: do not use placeholder text. Polaris (its web components): use it to show the format and tone.

A character count?

Open
Ours

None. A limit is the native maxLength.

Other systems

Atlassian has a counter with a minimum, a maximum or both, and calls it more accessible than the native limit. Primer has a character limit prop. Polaris (its web components) advises showing how many characters are left.

A monospace one?

Open
Ours

No prop. Screens that want it pass a monospace text class today: the model form's JSON, the import card, the secret map.

Other systems

Atlassian has a monospace prop on its text area.

Sizes?

Open
Ours

One: 13px text, the Input's at md.

Other systems

Atlassian has an isCompact prop. Primer, Polaris and shadcn show no size.

Buttons inside the box?

Open
Ours

None. The assistant's composer and the run-template box put their buttons beside or under the Textarea.

Other systems

shadcn's input group takes a text area with a bar above or below it, inside one box: a counter, a send button.

Other systems

Read for this page: shadcn's Textarea and Input Group pages; Atlassian's Text area (usage and code) and Form pages; GitHub Primer's Textarea page, its accessibility page and its props file in the primer/react repository; and Shopify Polaris's text area in its web components docs on shopify.dev (the React pages now redirect there). Base UI has no text area. States they share with ours are left out, and so is what the open questions above already cover.

They exposeOursWhy
Resizing sideways, or both ways (Primer, by default; Atlassian, as an option)AskNot built: ours resizes up and down only.
A switch for growing with the text (Primer; Atlassian's resize modes)Already thereOurs always grows. It cannot be turned off.
Rows, a minimum and a maximum height as props (Primer, Atlassian; rows in Polaris)AskNot built. A min-h-* or max-h-* class does it today.
A success state (Primer)AskNot built: ours has an invalid state only.