4.0 KiB
templateEngineOverride, layout, title, description, toc
| templateEngineOverride | layout | title | description | toc | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| njk | layouts/page.njk | Textarea | Displays a form textarea or a component that looks like a textarea. |
|
{% 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") }}
Usage
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.
{{ code_block(code) }}
Examples
Field
Use field with a label and description to create an accessible textarea.
{% set code_field %}
Write a short message.
Disabled
{% set code_disabled %}{% endset %} {{ code_preview("textarea-disabled", code_disabled, class="w-full max-w-xs") }}
Invalid
{% set code_invalid %}
Message is required.
Button
{% set code_button %}
Submit
Form
{% set code_form %}
You can @mention other users and organizations.
RTL
Textareas support right-to-left layouts through native browser direction handling. Add dir="rtl" to the textarea, field, or an ancestor.
{% set code_rtl %}
شاركنا أفكارك حول الخدمة.