Textarea
Data inputA multi-line text input with bind:value that grows with its text. Inside a Field it takes its id, label, description, error and disabled state from the Field.
import { Textarea } from '@limerdev/zest'; Use for
Free text longer than a line: a comment, a description, a note on an order.
Don't
A single line of text: use
Input. A Textarea without a label.Examples
Basic
A Textarea grows with its text.
0 characters
<script lang="ts">
import { Field, Textarea } from '@limerdev/zest';
let note = $state('');
</script>
<Field.Root class="max-w-sm">
<Field.Label>Note</Field.Label>
<Textarea bind:value={note} placeholder="Visible to the customer" />
<Field.Description>{note.length} characters</Field.Description>
</Field.Root> Invalid and disabled
A Field.Error marks the Textarea invalid; a disabled Field disables it.
Tell the customer why.
<script lang="ts">
import { Field, Textarea } from '@limerdev/zest';
</script>
<div class="grid w-full max-w-sm gap-6">
<Field.Root>
<Field.Label>Reason</Field.Label>
<Textarea />
<Field.Error errors={[{ message: 'Tell the customer why.' }]} />
</Field.Root>
<Field.Root disabled>
<Field.Label>Internal note</Field.Label>
<Textarea value="Locked once the invoice is sent." />
</Field.Root>
</div> Props
Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that
renders your own element, with props to spread on it).
Textarea
| Prop | Type | Default | Description |
|---|---|---|---|
| value bindable | string | null | – | The text. Bindable. |