import {InputTextareaModule} from 'primeng/inputtextarea';
InputTextarea is applied to an input field with pInputTextarea directive.
<textarea pInputTextarea></textarea>
A model can be bound using the standard ngModel directive.
<textarea pInputTextarea [(ngModel)]="property"></textarea>
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>
| 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. |
| Name | Parameters | Description |
|---|---|---|
| onResize | event: Event object | Callback to invoke when element is resized. |
Following is the list of structural style classes, for theming classes visit theming page.
| Name | Element |
|---|---|
| ui-inputtextarea | Textarea element |
None.
<h3 class="first">Default</h3>
<textarea rows="5" cols="30" pInputTextarea></textarea>
<h3>AutoResize</h3>
<textarea rows="5" cols="30" pInputTextarea autoResize="autoResize"></textarea>