
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







