Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

autoresize

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoresize

Automatically resize the inputs.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
decreased by-11.76%
Maintainers
1
Weekly downloads
 
Created
Source

autoresize

Automatically resize the inputs.

Examples

You can try TextArea or Input examples in your browser.
Note: Autoresize of the <input> element is not yet implemented.

Install

Node
npm i roll-parser

Then in your project require it:

const autoresize = require('autoresize');

Or use ES import:

import autoresize from 'autoresize';
Browser

Note: You will have access to the global autoresize function, that will be added to the window object.

<script src="https://unpkg.com/autoresize/dist/autoresize.js"></script>

Minified version:

<script src="https://unpkg.com/autoresize/dist/autoresize.min.js"></script>

ES5 version:

<script src="https://unpkg.com/autoresize/dist/autoresize.es5.js"></script>

Minified ES5 version:

<script src="https://unpkg.com/autoresize/dist/autoresize.es5.min.js"></script>

Usage

const element = document.querySelector('#textarea');
const options = { maximumRows: 5 };
autoresize(element, options);
Paramenters
element

An HTML element of types: HTMLTextAreaElement or HTMLInputElement.

options

An options object, that is different for each element type.

TextArea

{
  minimumRows: 1,
  maximumRows: Infinity,
  rowHeight: null
}

Passing the rowHeight value may be a bit more performant solution, but it will mean you can guarantee that the lineSize won't be changed in future with JS or CSS (including some @media queries). Otherwise, rowHeight will be calculated on the initial step and recalculated on window 'resize' event.

Input

{
  maxWidth: null
}

License

MIT © Mikita Taukachou

Keywords

FAQs

Package last updated on 23 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc