react-textarea-auto-witdth-height
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

react-textarea-auto-witdth-height

codecov License: MIT semantic-release: angular Github All Releases example workflow

An easy to use replacement for textarea that can automatically resizes both horizontally and vertically as content changes.

  import { AutoTextArea } from 'react-textarea-auto-witdth-height'

  const somePlace = () => (
    <div>
      <AutoTextArea/>
    </div>
  )

Demo

https://react-textarea-auto-witdth-height-8j96.vercel.app/

Install

npm i react-textarea-auto-witdth-height

Props

Props are almost identical as native textarea, except rows and cols are not supported, please use min-height and max-height to style the component instead.

FAQ

How to focus

Reference the inner textarea

<TextareaAutosize ref={(ref) => (this.current = ref)} />

Then focus on the ref

this.current.focus();

Package Sidebar

Install

npm i react-textarea-auto-witdth-height

Weekly Downloads

568

Version

1.0.3

License

MIT

Unpacked Size

24.7 kB

Total Files

13

Last publish

Collaborators

  • jimmy-wu