An open API service indexing awesome lists of open source software.

https://github.com/frsource/autoresize-textarea

Minimalistic plugin to autoresize your textareas 💪
https://github.com/frsource/autoresize-textarea

autoresize-textarea autosize js textarea

Last synced: about 1 month ago
JSON representation

Minimalistic plugin to autoresize your textareas 💪

Awesome Lists containing this project

README

          



NPM version badge


GZIP size calculated by bundlejs.com


semantic-release badge


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

```bash
npm install @frsource/autoresize-textarea

yarn add @frsource/autoresize-textarea

pnpm add @frsource/autoresize-textarea
```

### Modern JS/Typescript

```ts
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

```js
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](https://www.frsource.org/autoresize-textarea).

## Questions

Don’t hesitate to ask a question directly on the [discussions board](https://github.com/FRSOURCE/autoresize-textarea/discussions)!

## Changelog

Changes for every release are documented in the [release notes](https://github.com/FRSOURCE/autoresize-textarea/releases) and [CHANGELOG file](https://github.com/FRSOURCE/autoresize-textarea/tree/master/CHANGELOG.md).

## License

[MIT](https://opensource.org/licenses/MIT)

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