A Vue.js Directive That Content-based Automatic Input Resizing

Vue input autowidth is a Vue.js directive that automatically resizes the input width to fit its contents.

increase input box size dynamically, auto expand input width based on text length, input width auto resize css, auto resize textarea to fit content, input width fit content

Table of Contents

How to make use of it:

Install and download:

# Yarn
$ yarn add vue-input-autowidth

# NPM
$ npm install vue-input-autowidth --save

Install it with package managers.

# Yarn
$ yarn add vue-input-autowidth

# NPM
$ npm install vue-input-autowidth --save

Import “vue-input-autowidth”.

import VueInputAutowidth from 'vue-input-autowidth'

Enable the plug-in.

Vue.use(VueInputAutowidth)

Apply the plugin to your input field.

<input
  type="text"
  v-autowidth="{maxWidth: '960px', minWidth: '20px', comfortZone: 0}"
  v-model="name"
  placeholder="Type something here."
/>

Options and assumptions.

{

  // max width in pixels
  maxWidth: "none", 

  // min width in pixels
  minWidth: "none", 

  // additional space in pixels
  comfortZone: 0
  
}

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.

Auto Resize Input Based On Content, vue input autowidth Plugin/Github

increase input box size dynamically


See Demo And Download

Official Website(syropian): Click Here

This superior jQuery/javascript plugin is developed by syropian. For extra Advanced Usages, please go to the official website.

Related Posts

Confetti-Falling-Animation-Effect-party

Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…

Star-Rating-JavaScript

Select Box Based Star Rating JavaScript Library | star-rating.js

star-rating.js is a small JavaScript library to create a customizable and gradually improved star rating control from a regular tick box with numeric values. The ES6 module…

Bootstrap-Show-Notification

Corner Fixed Notifications Alerts With Bootstrap | BS4 Show Notification

Bootstrap Notification is an easy-to-use jQuery plugin that uses the Bootstrap Alerts component to create static, rejectable, and stackable notification popups in the upper right corner of the…

Stackable-Multi-level-Sidebar-Menu

Create Stackable Multi-level Sidebar Menu | HC Off-canvas Nav

Multi-Level Sidebar Slide Menu – HC MobileNav is a jQuery plugin for creating multi-level, mobile-first, totally accessible, off-canvas facet navigation that helps the infinite nesting of submenu…

vue-masonry-gallery

Responsive Masonry Layout with SSR Support for Vue 3 | vue-masonry-wall

Vue masonry wall is a responsive masonry layout component for Vue 3 to deliver a Masonry-style responsive grid layout with SSR and RTL layout support. Features 📱…

bootstrap-5-bs-toaster

A Bootstrap 5 Toast Notification Framework Library | bs-toaster

bs-toaster is simple to instantiate bs-toaster and create multiple toasts effortlessly using native Bootstrap 5! Feature Facts Small and clean Modern browser support. No IE sorry 💥…