Tiny JS Library To Auto Resize Input Filed – autosize-input.js

Category: Form , Javascript | July 20, 2018
Author:yuanqing
Views Total:517 views
Official Page:Go to website
Last Update:July 20, 2018
License:MIT

Preview:

Tiny JS Library To Auto Resize Input Filed – autosize-input.js

Description:

autosize-input.js is a lightweight and easy-to-implement JS library that dynamically & automatically resizes the width of input fields according to the content while typing.

Installation:

# Yarn
$ yarn add autosize-input

# NPM
$ npm install autosize-input --save

How to use it:

Make sure to load the autosize-input.js script before the closing body tag.

<script src="autosize-input.min.js"></script>

Call the plugin on the input fields and done.

autosizeInput(document.querySelector('#demo'));

Set the minWidth option to true if you want to make the input field has the minimum width based on its placeholder attribute.

autosizeInput(document.querySelector('#demo'), { minWidth: true });

Changelog:

v1.0.2 (07/20/2018)

  • Update dependencies

You Might Be Interested In:


Leave a Reply