# textarea-autosizer

> Textarea Autosizer automatically resizes the height of a textarea based on the content entered or pasted inside it.

Latest version **0.0.5** (published 2023-09-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install textarea-autosizer
pnpm add textarea-autosizer
yarn add textarea-autosizer
bun add textarea-autosizer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-09-19 |
| First published | 2023-09-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Raphaël Paré |
| Maintainers | raphpare |
| Keywords | auto-height, textarea, input, resize |

## Links

- npm: https://www.npmjs.com/package/textarea-autosizer
- Repository: https://github.com/raphpare/textarea-autosizer
- Homepage: https://github.com/raphpare/textarea-autosizer.git
- Issues: https://github.com/raphpare/textarea-autosizer/issues
- npm.io page: https://npm.io/package/textarea-autosizer

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2023-09-19
- 0.0.4 — 2023-09-19
- 0.0.3 — 2023-09-19
- 0.0.2 — 2023-09-18
- 0.0.1 — 2023-09-18

## README

# Textarea Autosizer [dependency-free]
Textarea Autosizer automatically resizes the height of a textarea based on the content entered or pasted inside it.

[Live example](https://raphpare.github.io/textarea-autosizer)

## Getting Started
1. [Install](#install)
2. [Examples](#examples)
2. [Methods](#methods)

## Install

### npm
```
npm i textarea-autosizer --save
```

### Yarn

```
yarn add textarea-autosizer
```

## [Examples](https://raphpare.github.io/textarea-autosizer)

### HTML
``` HTML
<textarea></textarea>
```

### TypeScript
#### setTextareaAutosizer() Fonction
``` TS
import { setTextareaAutosizer } from 'textarea-autosizer';

const refTextarea = document.querySelector('textarea');
const textareaAutosizer = setTextareaAutosizer(refTextarea);

// Remove textareaAutosizer
// textareaAutosizer.remove();

```

#### TextareaAutosizer Class
``` TS
import { TextareaAutosizer } from 'textarea-autosizer';

const refTextarea = document.querySelector('textarea');

const textareaAutosizer = new TextareaAutosizer();
textareaAutosizer.set(refTextarea);
```

## Methods

### TextareaAutosizer.set(htmlTextAreaElement, options)
Initializing the Textarea Autosizer.

#### Options
| Attribute | Description |
| -- | -- |
| minHeight?: `number` | Minimum height of textarea |
| maxHeight?: `number` | Maximum height of textarea |


### TextareaAutosizer.remove()
Remove automatic textarea resizing.

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