FRSOURCE / autoresize-textarea

Minimalistic plugin to autoresize your textareas 💪

Home Page:https://www.frsource.org/autoresize-textarea/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NPM version badge Core bundle size badge. Data from bundlephobia.com semantic-relase badge Tree shaking supported license MIT badge

Autoresize Textarea - minimalistic plugin to autosize your textareas! 💪

Getting Started · Demo · File an Issue · Have a question or an idea?


Tiny library which make your textareas fluid.
Mobile & desktop-friendly
Performant & with small bundle size (less than 1.2kB!)
Published as separate bundles for JS ES5 or modern browsers thanks to microbundle
Written completely in typescript

Published under MIT license

Quick start

Installation

npm install @frsource/autoresize-textarea

yarn add @frsource/autoresize-textarea

pnpm add @frsource/autoresize-textarea

Modern JS/Typescript

import { attach } from "@frsource/autoresize-textarea";
const textarea = document.querySelector("textarea");
const { detach } = attach(textarea);

// detach plugin whenever you want (e.g. on component unmount)
// detach();

UMD

const textarea = document.querySelector("textarea");
const { detach } = window.autoresizeTextarea.attach(textarea);

// detach plugin whenever you want (e.g. on component unmount)
// detach();

For working example, check out our demo.

Questions

Don’t hesitate to ask a question directly on the discussions board!

Changelog

Changes for every release are documented in the release notes and CHANGELOG file.

License

MIT

Copyright (c) 2022-present, Jakub FRS Freisler, FRSOURCE

About

Minimalistic plugin to autoresize your textareas 💪

https://www.frsource.org/autoresize-textarea/

License:MIT License


Languages

Language:TypeScript 80.4%Language:JavaScript 19.6%