DirectiveOptional

wrAutosize

Grow a <textarea> with its content, between minRows and maxRows.

Installation

Import the class, and @use the entry point in your global styles: without it the component renders unstyled.

import { Component } from '@angular/core';
import { WrAutosize } from 'ngwr/directives';
import { WrInput } from 'ngwr/input';

@Component({ imports: [WrAutosize, WrInput] })
export class MyComponent {}

Usage

<textarea wrAutosize minRows="2" maxRows="8" [(ngModel)]="text"></textarea>

API

NameDescriptionTypeDefault
[wrAutosize]Grows the <textarea> with its content.directive on textarea—
minRowsFewest rows.number1
maxRowsMost rows. 0 means no limit.number0

See also