--- templateEngineOverride: njk layout: layouts/page.njk title: Textarea description: Displays a form textarea or a component that looks like a textarea. toc: - label: Usage id: usage - label: Examples id: examples children: - label: Field id: example-field - label: Disabled id: example-disabled - label: Invalid id: example-invalid - label: Button id: example-button - label: Form id: example-form - label: RTL id: example-rtl --- {% from "macros/code_preview.njk" import code_preview %} {% from "macros/code_block.njk" import code_block %} {% set code %}{% endset %} {{ code_preview("textarea", code, class="w-full max-w-xs") }}
Add the textarea class to a <textarea> element. Textareas inside a form or field container also receive the same styling automatically.
Use native HTML attributes for behavior: disabled for disabled textareas and aria-invalid="true" for invalid state styling.
Use field with a label and description to create an accessible textarea.
Write a short message.
Message is required.
Textareas support right-to-left layouts through native browser direction handling. Add dir="rtl" to the textarea, field, or an ancestor.
شاركنا أفكارك حول الخدمة.