# @github/textarea-autosize

> Autosizes textarea to size of it's contents.

Latest version **0.3.3** (published 2023-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @github/textarea-autosize
pnpm add @github/textarea-autosize
yarn add @github/textarea-autosize
bun add @github/textarea-autosize
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2023-11-30 |
| First published | 2018-08-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 103 |
| Maintainers | andrialexandrou, jfuchs, githubbot, manuelpuyol, jonrohan, broccolini, primer-css, keithamus, mschoening, colebemis, smockle, simurai, khiga8, dustin.greif, srt32 |

## Links

- npm: https://www.npmjs.com/package/@github/textarea-autosize
- Repository: https://github.com/github/textarea-autosize
- Homepage: https://github.com/github/textarea-autosize#readme
- Issues: https://github.com/github/textarea-autosize/issues
- npm.io page: https://npm.io/package/@github/textarea-autosize

## Recent versions

- 0.3.3 (latest) — 2023-11-30
- 0.3.1 — 2022-10-31
- 0.3.0 — 2022-08-19
- 0.2.2 — 2021-03-15
- 0.2.1 — 2020-12-09
- 0.2.0 — 2019-11-14
- 0.1.3 — 2019-11-06
- 0.1.2 — 2019-09-11
- 0.1.1 — 2019-08-30
- 0.1.0 — 2018-08-08
- 0.0.2 — 2018-08-08
- 0.0.1 — 2018-08-08

## README

# Textarea Autosize

Autosizes textarea to size of its contents.

## Installation

```
$ npm install @github/textarea-autosize
```

## Usage

The autosizing behavior must be explicitly activated on the `<textarea>`.

```js
import autosize from '@github/textarea-autosize'
autosize(document.querySelector('textarea.foo'))
```

Using a library like [selector-observer](https://github.com/josh/selector-observer), the behavior can automatically be applied to any textareas matching a class name.

```js
import {observe} from 'selector-observer'
import autosize from '@github/textarea-autosize'

observe('textarea.autosize', { subscribe: autosize })
```

## Browser support

- Chrome
- Firefox
- Safari
- Internet Explorer 11
- Microsoft Edge

## Development

```
npm install
npm test
```

## License

Distributed under the MIT license. See LICENSE for details.

---
_Source: https://npm.io/package/@github/textarea-autosize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
