Textarea
A multi-line text input.
Overview
Text that runs to a sentence or a paragraph: a review, a note, a message.
Long text
Do
What did you find? How were the prices?
import { Field, Textarea } from "@hackcove/ui";
<Field label="Review" htmlFor="do-review" hint="What did you find? How were the prices?">
<Textarea id="do-review" rows={4} />
</Field>Textarea in a Field, so the person can see what they wrote.Don't
What did you find? How were the prices?
import { Field, Input } from "@hackcove/ui";
<Field label="Review" htmlFor="dont-review" hint="What did you find? How were the prices?">
<Input id="dont-review" />
</Field>Input is one line: a paragraph typed into it scrolls out of sight.Usage
- Put a
Textareain aField, as with anInput. rowsis 3 unless you set it; set more for a long answer.sizeandwidthare the same choices as onInput.- One line of text is an
Input.
Accessibility
- A
Textareais a native<textarea>: it takesname,required,disabled,maxLengthand thearia-*props. - The focus ring comes from the component.
API
Textarea
A multi-line text input, styled like Input. rows defaults to 3. Takes size and width too.
sizesm is compact, text-xs with less padding, for dense forms and table rows.
- Type
"sm" | "md"- Default
md
widthfull (default) fills the parent; fill grows to fill the room left in a row beside other items (it can shrink to nothing, so buttons stay on the line); xs, sm, md, lg are fixed; auto is as wide as its content.
- Type
"auto" | "sm" | "md" | "lg" | "xs" | "fill" | "full"- Default
full