<textarea class="textarea" placeholder="Type your message here"></textarea>
Usage
Simply add the textarea
class to your <textarea>
element or have a parent with the form
class (read more about form). You can also set the aria-invalid
attribute to true
to make the textarea invalid.
<textarea class="textarea" placeholder="Type your message here"></textarea>
Examples
<textarea class="textarea" placeholder="Type your message here"></textarea>
Invalid
<textarea class="textarea" placeholder="Type your message here" aria-invalid="true"></textarea>
Disabled
<textarea class="textarea" placeholder="Type your message here" disabled></textarea>
With label
<div class="grid gap-3">
<label for="textarea-with-label" class="label">Label</label>
<textarea id="textarea-with-label" class="textarea" placeholder="Type your message here"></textarea>
</div>
With text
Type your message and press enter to send.
<div class="grid gap-3">
<label for="textarea-with-label" class="label">Label</label>
<textarea id="textarea-with-label" class="textarea" placeholder="Type your message here"></textarea>
<p class="text-muted-foreground text-sm">Type your message and press enter to send.</p>
</div>
With button
<div class="grid gap-3">
<textarea id="textarea-with-label" class="textarea" placeholder="Type your message here"></textarea>
<button type="submit" class="btn">Submit</button>
</div>
Form
<form class="form space-y-6">
<div class="grid gap-3">
<label for="textarea-form" class="label">Bio</label>
<textarea id="textarea-form" placeholder="Tell us a bit about yourself"></textarea>
<p class="text-muted-foreground text-sm">You can @mention other users and organizations.</p>
</div>
<button type="submit" class="btn">Submit</button>
</form>