Skip to content
R

react-input-autosize

Auto-resizing Input Component for React

by jedwatsonFree

#75in UI Libraries
0In stores

Description

React-input-autosize is a text input component for React that resizes itself to fit its current content. It wraps the input so it can measur…

Highlights

  • Text input that grows and shrinks with its content
  • Install from NPM or use the UMD build in a page
  • Controlled input driven by the value prop
  • Documented gotchas for runtime styles, CSP and custom fonts

Ratings & Reviews

No ratings yet

Be the first to rate react-input-autosize.

People also visit

R

react-textarea-autosize

textarea component for React which grows with content

UI Libraries
Launch
R

react-textarea-autosize

component for React which grows with content

UI Libraries
Launch
R

react-autosize-textarea

replacement for built-in textarea which auto resizes itself

UI Libraries
Launch
R

react-textfit

React component to fit headlines and paragraphs into any element

UI Libraries
Launch
R

react-resizable-box

Resizable component for React. #reactjs

UI Libraries
Launch
R

react-text-truncate

Truncate text for React.js

UI Libraries
Launch

react-input-autosize FAQ

What does react-input-autosize do?

It is a text input for React that resizes itself to the current content, behaving like a standard input otherwise.

How do I install it?

Install it from NPM and include it in your React build with a bundler such as webpack, Rollup or Browserify. A UMD build is also available as dist/AutosizeInput.js.

Can I use it as an uncontrolled input?

No. The component is controlled and depends on the value prop.

What if my styles change after mount?

Styles are copied only at mount, so remount the input with a new key or call copyInputStyles() after the styles change.

Does it work with a strict Content Security Policy?

The component injects a stylesheet by default, which some CSP policies block. You can pass injectStyles={false} and style the input yourself.

Is it free?

Yes. It is released under the MIT license by its author, Jed Watson.

Where can I see it working?

The project has a live demo at jedwatson.github.io/react-input-autosize, and examples can be run locally.

What are the best react-input-autosize alternatives?

Popular alternatives to react-input-autosize include react-textarea-autosize, react-textarea-autosize and react-autosize-textarea. See all react-input-autosize alternatives

Developer Stuff

Badges