@gdo-bzh/textarea-autosize
v1.0.0-rc.4
Published
![version](https://img.shields.io/npm/v/@gdo-bzh/textarea-autosize)
Downloads
2
Readme
textarea-autosize
A textarea component which automatically adjust its height on keyboard and window resize events
Install
yarn add @gdo-bzh/textarea-autosize react
Usage
import React from 'react'
const Example: React.FC = () => (<TextareaAutosize autofocus autoselect placeholder="type text" />)
Types
type Props = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'rows'> & State
type State = {
/**
* true to autoselect text content at initialize
*/
autoselect?: boolean;
/**
* the value of an <textarea> element
*/
value?: React.TextareaHTMLAttributes<HTMLTextAreaElement>['value'];
/**
* Minimum number of rows to display. Default value is 1
*/
minRows?: number;
/**
* Maximum number of rows to display.
*/
maxRows?: number;
}
License
MIT © gdo-bzh