BrowseTextarea

Controls

Glass Textarea

A multi-line field that can grow with what you type.

Preview

Installation

Install the package once, then import the parts you use into a standalone component.

Install

npm install ngx-vitreo @angular/cdk @floating-ui/dom
Import

import { GlassTextarea } from 'ngx-vitreo';

@Component({
  imports: [GlassTextarea],
  // ...
})

Usage

Usage

<form class="cpreview-stack" (ngSubmit)="send()">
  <textarea
    glassTextarea
    autoResize
    hint="Grows as you type, up to five rows."
    label="Message"
    [maxRows]="5"
    placeholder="Say hello…"
    name="message"
    [(ngModel)]="message"
  ></textarea>
  <button glassButton type="submit" variant="prominent">Send</button>
</form>

API reference

GlassTextarea

textarea[glassTextarea]

InputTypeDefaultDescription
labelstringNoneVisible label above the field, linked with for.
hintstringNoneHelper text below the field, linked with aria-describedby.
rowsnumber3Starting height in rows. Without autoResize the field has a vertical resize handle.
autoResizebooleanfalseGrows with its text, refitting when the width changes or a form writes a value, then scrolls past maxRows.
maxRowsnumber8The most rows an auto-resizing field grows to.