Back to Tuist

TextArea

noora/docs/components/textarea.md

4.204.02.9 KB
Original Source
<!-- Generated by scripts/generate-web-components.js. Do not edit directly. -->

TextArea

Collects multi-line text with labels, hints, errors, and character counting.

html
<noora-text-area label="Description" name="description"></noora-text-area>

Attributes

AttributeType or allowed valuesDefaultDescription
labelstringNoneSets the field label.
sublabelstringNoneSets secondary label text.
hintstringNoneSets supporting text.
hint-variantdefault, destructive, disabled"default"Controls hint semantics.
errorstringNoneSets the validation error.
namestring""Sets the submitted field name.
valuestring""Gets or sets the field value.
placeholderstringNoneSets placeholder text.
requiredbooleanfalseMarks the field as required.
show-requiredbooleanfalseShows the required indicator.
rowsnumber4Sets the visible row count.
max-lengthnumber200Sets the maximum character count.
show-character-countbooleantrueShows the current character count.
resizenone, both, horizontal, vertical"vertical"Controls native resizing.
disabledbooleanfalseDisables the field.

Read-only properties

PropertyTypeDescription
controlHTMLTextAreaElement | nullThe native text area.
formHTMLFormElement | nullThe associated form.

Events

EventTypeDescription
inputInputEventEmitted while the text value changes.
changeEventEmitted after the text value is committed.

Styling parts

PartDescription
textareaThe native text area.
character-countThe character counter.

The component emits standard input and change events.

Basic

Collect longer supporting text.

html
<noora-text-area name="basic" placeholder="Enter your message..." max-length="200"></noora-text-area>

Required

Mark required fields visibly and semantically.

html
<noora-text-area name="required" label="Message" placeholder="This field is required" required show-required></noora-text-area>

With hint

Give supporting guidance below the field.

html
<noora-text-area name="feedback" label="Feedback" placeholder="Share your feedback..." hint="Please be as detailed as possible"></noora-text-area>

Error

Communicate validation failures.

html
<noora-text-area name="error" label="Message" placeholder="Enter your message..." error="This field is required"></noora-text-area>

Disabled

Prevent editing while preserving context.

html
<noora-text-area name="disabled" label="Disabled" placeholder="Enter your message..." disabled></noora-text-area>