# vue-input-autowidth

> A Vue.js directive for adjusting a text input's width to fit its content.

Latest version **1.0.11** (published 2021-03-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-input-autowidth
pnpm add vue-input-autowidth
yarn add vue-input-autowidth
bun add vue-input-autowidth
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-03-07 |
| First published | 2017-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 22.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 106 |
| Author | Collin Henderson |
| Maintainers | syropian |
| Keywords | vue, input, autowidth, autosize, autogrow |

## Links

- npm: https://www.npmjs.com/package/vue-input-autowidth
- Repository: https://github.com/syropian/vue-input-autowidth
- npm.io page: https://npm.io/package/vue-input-autowidth

## Dependencies (1)

- [es6-object-assign](https://npm.io/package/es6-object-assign.md) ^1.1.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.11 (latest) — 2021-03-07
- 2.2.1 (next) — 2023-05-24
- 2.2.0 — 2021-09-25
- 2.0.2 — 2021-09-24
- 2.0.1 — 2021-09-21
- 2.0.0 — 2021-09-19
- 1.0.10 — 2020-02-27
- 1.0.9 — 2019-09-14
- 1.0.8 — 2019-09-11
- 1.0.7 — 2019-09-01
- 1.0.6 — 2019-08-29
- 1.0.5 — 2019-05-06
- 1.0.4 — 2019-05-05
- 1.0.3 — 2019-02-19
- 1.0.2 — 2017-11-10
- … 1 more at https://npm.io/package/vue-input-autowidth/versions

## README

# vue-input-autowidth [![Actions Status](https://github.com/syropian/vue-input-autowidth/workflows/Tests/badge.svg)](https://github.com/syropian/vue-input-autowidth/actions)

> A Vue.js directive for adjusting a text input's width to fit its content.

![](http://d.pr/i/lfmNKs+)

**[Demo](https://syropian.github.io/vue-input-autowidth/)**

### Install

```bash
$ yarn add vue-input-autowidth
```

or

```bash
$ npm install --save vue-input-autowidth
```

It's also available on Unpkg: https://unpkg.com/vue-input-autowidth

### Usage

```js
import VueInputAutowidth from 'vue-input-autowidth'

Vue.use(VueInputAutowidth)

// and in your template...
<input
  type="text"
  v-autowidth="{maxWidth: '960px', minWidth: '20px', comfortZone: 0}"
  v-model="name"
  placeholder="Watch me change size with my content!"
/>
```

### Options

#### maxWidth

Type: `String`
Default: `'none'`

The maximum width the input field will grow to.

#### minWidth

Type: `String`
Default: `'none'`

The minimum width the input field will shrink to.

#### comfortZone

Type: `Number`
Default: `0`

The additional space in pixels to add to the far side of the input's content.

### Development

```bash
# To run the example
$ npm run example

# To run the tests
$ npm test

# To publish the dist file
$ npm run build
```

### License

MIT © [Collin Henderson](https://github.com/syropian)

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