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/domImport
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]
| Input | Type | Default | Description |
|---|---|---|---|
label | string | None | Visible label above the field, linked with for. |
hint | string | None | Helper text below the field, linked with aria-describedby. |
rows | number | 3 | Starting height in rows. Without autoResize the field has a vertical resize handle. |
autoResize | boolean | false | Grows with its text, refitting when the width changes or a form writes a value, then scrolls past maxRows. |
maxRows | number | 8 | The most rows an auto-resizing field grows to. |