Components
Textarea
A multi-line text field that grows with what you type, then scrolls.
Everyone in the room sees it after the credits.
import { Field } from "@sideby/ui/field";
import { Textarea } from "@sideby/ui/textarea";
<Field label="Say something nice about the film" description="Everyone in the room sees it after the credits.">
{#snippet control(attrs)}
<Textarea {...attrs} name="note" />
{/snippet}
</Field> When to use it
Use a Textarea when the answer can run past one line: a note for the room, a longer message, feedback. For a name, a link or a code, use an Input. Wrap it in a Field so the label, description and error are wired to it for you; the control snippet works exactly as it does for an Input.
It grows, then scrolls
The box starts about four lines tall and grows with its content through field-sizing-content. At its maximum height it stops growing and scrolls, so a long paragraph never pushes the rest of the page away. Browsers without field-sizing keep the starting height and scroll from there.
import { Field } from "@sideby/ui/field";
import { Textarea } from "@sideby/ui/textarea";
<Field label="Say something nice about the film">
{#snippet control(attrs)}
<Textarea {...attrs} name="note" value={longNote} />
{/snippet}
</Field> Accessibility
- A label is required. Field renders a visible one tied through
forandid. - Text is 16px (
text-input), so iOS Safari never zooms when the field takes focus. - Errors are announced through Field’s polite live region and linked with
aria-describedby. The words carry the meaning; the red edge is a second cue. - Tab moves into the field and shows the ring outline. Inside it, Tab moves on to the next control rather than typing a tab character. The edge uses
border-control, which holds 3:1 in both themes.
Copy
- Labels invite the answer: “Say something nice about the film” says what to write and sets the tone.
- Descriptions say who sees it or what happens next: “Everyone in the room sees it after the credits.”
- Errors say what to change, following the voice guide: “That’s a lot of nice for one note. Trim it under 280 characters and try again.”