v-autosize

Lightweight Vue wrapper for `autosize`
207,568 17
Install
npm install v-autosize
Latest Version:2.0.1
Vue:3
License:MIT
Last Updated:Feb 1, 2025
Links: GitHub  ·  npm
Maintainer: shrpne

v-autosize

NPM Package Minified Size Build Status License: MIT

Lightweight Vue 3 wrapper for autosize. Use v-autosize directive on the textarea element to make it automatically adjust height to fit text.

Using Vue 2?

Check old version v-autosize@1

Install

npm install v-autosize

Register

Register directive locally in the component

import autosize from 'v-autosize';

// Your component
export default {
    directives: {
        autosize,
    }
}

Or register directive globally in the root Vue instance

import { createApp } from 'vue'
import autosizePlugin from 'v-autosize/src/plugin.js';

const app = createApp({})
app.use(autosizePlugin)

Use

Use v-autosize directive on the textarea element

<textarea v-autosize></textarea>

Comparison

  • This module: Minified Size Minified Size
  • vue-autosize: Minified Size Minified Size Doesn't support Vue 3, autosize-input included, not maintained.
  • vue-textarea-autosize: Minified Size Minified Size Doesn't support Vue 3. A component is used instead of a directive.

License

MIT License

Related Packages

vue-autosize

autosize for vue directive

87,909
vue-textarea-autosize

Vue component provides textarea with automatically adjustable height and without...

456,868 124
vue-r-mask

Masked input directive for vue.js 2

7,495
@vue-interface/autogrow

A Vue directive that makes textareas grow as the user types.

2,863 3
vue3-highlight-text

a vue3 directive of highlight text

84,789

Version History

Version Released License
2.0.1 MIT
2.0.0 MIT
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT