FormsTextarea
Searchastronomic.dev# Textarea For longer answers in a form, like a project brief. Static: no JavaScript. ## Usage ```astro import Textarea from "@astronomic-dev/ui/components/Textarea.astro"; ``` ## Examples ### Project brief ```astro --- import Field from "@astronomic-dev/ui/components/Field.astro"; import Textarea from "@astronomic-dev/ui/components/Textarea.astro"; --- <div class="max-w-xl"> <Field label="About the project" for="textarea-brief"> <Textarea id="textarea-brief" name="brief" placeholder="What do you need, and by when?" /> </Field> </div> ``` ## Props ### Textarea | Prop | Type | Default | Description | | --- | --- | --- | --- | | `invalid` | `boolean` | `false` | Marks the value as wrong (aria-invalid) and shows the danger border. | | `value` | `string` | None | The initial text. | | `class` | `string` | None | More classes, merged with cn(), so yours win on conflicts. | Any other attribute goes on the <textarea>. rows is 5 unless you set it. ## Accessibility - Renders a native <textarea>, 5 rows by default, that can be resized taller. - It has no label of its own: put it in a Field, or give it an aria-label. - invalid sets aria-invalid="true" and the danger border.
Textarea
FreeFor longer answers in a form, like a project brief.
- File
- Textarea.astro
- Group
- Forms
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Project brief
Force statemain.astro
examples/textarea/main.astro
---
import Field from "@astronomic-dev/ui/components/Field.astro";
import Textarea from "@astronomic-dev/ui/components/Textarea.astro";
---
<div class="max-w-xl">
<Field label="About the project" for="textarea-brief">
<Textarea id="textarea-brief" name="brief" placeholder="What do you need, and by when?" />
</Field>
</div>Minimal · Light