Skip to main content

upp-textarea

A multi-line text input component that integrates with Angular Reactive Forms. It supports configurable row count, kiosk mode, floating labels, and inline validation error display -- mirroring the same patterns as upp-input but for multi-line content.

When to Use

Use upp-textarea for any field where the user needs to enter longer text such as descriptions, notes, or comments. It provides the same form integration, error display, and kiosk support as upp-input, but renders a <textarea> element with a configurable number of rows.

Layout: Wrap upp-textarea in an ion-item so validation errors are positioned correctly (bottom-right). Without ion-item, the error message may not align with the field.

Demo

Source Code

<div class="demo-scroll-container">
<upp-scrollable [scrollbar]="'y'">
<div class="demo-content">
<h2>Product Description</h2>
<p class="demo-description">Edit a product's text content using <code>upp-textarea</code> with validation and character counting.</p>

<div class="demo-controls">
<ion-button size="small" (click)="toggleReadonly()">Readonly: {{ isReadonly }}</ion-button>
<ion-button size="small" color="warning" (click)="validate()">Validate</ion-button>
<ion-button size="small" color="medium" (click)="resetForm()">Reset</ion-button>
</div>
<p class="demo-hint">Validation errors appear when the field is touched (blur) or dirty. Leave the required field empty and blur to see errors.</p>

<div class="demo-section" [formGroup]="form">
<h3>Product Copy</h3>

<ion-list lines="none">
<ion-item>
<upp-textarea
formControlName="shortDescription"
placeholder="A brief summary of the product..."
title="Short Description (required) &mdash; {{ shortDescriptionLength }} chars"
[rows]="2"
[readonly]="isReadonly"
[kiosk]="false"
[errornfo]="errorMessages">
</upp-textarea>
</ion-item>

<ion-item>
<upp-textarea
formControlName="detailedNotes"
placeholder="Ingredients, allergens, storage instructions..."
title="Detailed Notes (optional) &mdash; {{ detailedNotesLength }} chars"
[rows]="5"
[readonly]="isReadonly"
[kiosk]="false">
</upp-textarea>
</ion-item>
</ion-list>
</div>
</div>
</upp-scrollable>
</div>

API Reference

UppTextAreaComponent (upp-textarea)

The main textarea component. Wraps upp-kb-textarea (keyboard-level textarea) and upp-er-textarea (inline error display) into a single, form-ready widget.

Inputs

PropertyTypeDefaultDescription
placeholderstring''Placeholder text shown when the field is empty.
formControlNamestring''Name of the reactive form control this textarea binds to.
readonlybooleanfalseWhen true, the textarea is read-only.
disabledbooleanfalseWhen true, the textarea is disabled. Also respects the parent FormGroup disabled state.
kioskbooleantrueEnables kiosk mode (on-screen keyboard) when the platform reports kiosk.
rowsnumber1Number of visible text rows.
titlestring''Floating label text displayed above the textarea when it has a value. Falls back to placeholder if empty.
autocompletestring'off'HTML autocomplete attribute value.
errornfoRecord<string, string>{}Map of validation error keys to human-readable messages.
valuestring | nullnullThe current value (two-way via ControlValueAccessor).

Outputs

EventPayloadDescription
Changedstring | nullEmitted when the value changes.
FocusvoidEmitted when the textarea gains focus.