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

Default

AutoResize

Import


import {InputTextareaModule} from 'primeng/primeng';

Getting Started

InputTextarea is applied to an input field with pInputTextarea directive.


<textarea pInputTextarea />

Model Binding

A model can be bound using the standard ngModel directive.


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

AutoResize

In auto resize mode, textarea grows instead of displaying a scrollbar.


<textarea pInputTextarea autoResize="autoResize"/>

Attributes

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.

Styling

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

Name Element
ui-inputtextarea Textarea element

Dependencies

Native directive that only requires the css of PrimeUI InputTextarea.


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

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