InputTextarea Inputtextarea add styling and autoResize functionality to standard textare element.

Default

AutoResize

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>

Properties

Name Type Default Description
autoResize boolean false When present, textarea size changes as being typed.
disabled boolean false When present, it specifies that the element should be disabled.

Events

Name Parameters Description
onResize event: Event object Callback to invoke when element is resized.

Styling

Following is the list of structural style classes, for theming classes visit theming page.

Name Element
ui-inputtextarea Textarea element

Dependencies

None.

View on GitHub

<h3 class="first">Default</h3>
<textarea rows="5" cols="30" pInputTextarea></textarea>

<h3>AutoResize</h3>
<textarea rows="5" cols="30" pInputTextarea autoResize="autoResize"></textarea>