Angular InputTextarea

Angular InputTextarea

·

2 min read

Angular InputTextarea is a multi-line text input element.

Setup

Refer to PrimeNG setup documentation for download and installation steps for your environment.

Import

import {InputTextareaModule} from 'primeng/inputtextarea';

Getting Started

InputTextarea is applied to an input field with pInputTextarea directive.

<textarea pInputTextarea></textarea>

Model Binding

A model can be bound using the standard ngModel directive.

<textarea pInputTextarea [(ngModel)]="property"></textarea>

AutoResize

In auto resize mode, textarea grows instead of displaying a scrollbar. When this feature is enabled, rows and cols properties are required to be defined.

<textarea [rows]="5" [cols]="30" pInputTextarea autoResize="autoResize"></textarea>

Theming

InputTextarea supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeNG InputTextarea showcase for demos and documentation.