ng-autosize-demo
v2.0.3
Published
Angular textarea autosize demo (auto-resize / elastic textarea height) with minHeight, maxHeight, and refresh() for programmatic updates.
Maintainers
Readme
ng-autosize-demo (demo for ng-autosize)
This repository is a demo app for the ng-autosize project: an Angular textarea autosize (“elastic height”) directive.
ng-autosizeon GitHub: https://github.com/stevepapa/ng-autosizeng-autosizeon npm: https://www.npmjs.com/package/ng-autosize
This demo shows how ng-autosize behaves in a modern Angular (v19) app: the textarea grows with content, supports minHeight / maxHeight, and includes a refresh() pattern for programmatic updates.
What you get
- Autosize on typing (no manual sizing)
- Min/Max height constraints (
[minHeight]/[maxHeight]in px) - Programmatic updates pattern: set value then call
refresh() - Standalone directive usage (no NgModule required)
Note: this repo vendors a small autosize directive in src/app/autosize.directive.ts to keep the demo buildable; the canonical library is ng-autosize linked above.
Quick start
npm install
npm startOpen http://localhost:4200/.
Build + test
npm run build
npm test -- --watch=false --browsers=ChromeHeadlessTo preview the production build output, serve dist/temp-ng19/browser with any static server.
Demo usage
In a template:
- Add
autosizeto a<textarea> - Optionally set
[minHeight]and/or[maxHeight] - Use
#ref="autosize"to callref.refresh()after programmatic changes
Publishing
This repo is configured to publish to npm on tags like v2.0.0 via .github/workflows/release.yml (requires NPM_TOKEN GitHub secret).
