Textarea
A controlled multi-line text input that integrates with Field.
TextareaView sourceExample
The preview is interactive. The code below it is the docs demo source; demo-only layout classes can be omitted in application code.
Supports labels, descriptions, errors, and inherited invalid state.
import { Cell } from "retend";
import { Field, Textarea } from "innate-ui";
import classes from "../docs.module.css";
export function TextareaDemo() {
const message = Cell.source("");
return (
<Field id="textarea-demo" class={classes.textareaDemo}>
<Field.Label>Message</Field.Label>
<Textarea
value={message}
onChange={(value) => message.set(value)}
placeholder="Write a message"
/>
<Field.Description>
Supports labels, descriptions, errors, and inherited invalid state.
</Field.Description>
</Field>
);
}API reference
This table is generated from Innate UI's exported TypeScript declarations and JSDoc. Native element attributes inherited by a prop type are not repeated here.
TextareaProps
| Prop | Type | Default |
|---|---|---|
valueTextarea value. | JSX.ValueOrCell<string> | — |
refReceives the native textarea element. | SourceCell<HTMLTextAreaElement | null> | — |
invalidWhether the textarea is in an invalid state. | JSX.ValueOrCell<boolean> | false |
ariaDescribedByIds of elements that describe the textarea. | JSX.ValueOrCell<string | undefined> | — |
onChangeCalled with the current string value after input. | (value: string) => void | — |
onInputNative input handler called before `onChange`. | EventHandlerProp<HTMLTextAreaElement, Event> | — |