https://github.com/react-component/textarea
React Textarea
https://github.com/react-component/textarea
Last synced: 4 months ago
JSON representation
React Textarea
- Host: GitHub
- URL: https://github.com/react-component/textarea
- Owner: react-component
- License: mit
- Created: 2020-06-08T14:20:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-07-29T07:50:28.000Z (5 months ago)
- Last Synced: 2025-08-22T09:24:12.945Z (4 months ago)
- Language: TypeScript
- Homepage:
- Size: 11.9 MB
- Stars: 29
- Watchers: 4
- Forks: 42
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# rc-textarea
[![NPM version][npm-image]][npm-url] [](https://github.com/umijs/dumi) [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url]
[npm-image]: http://img.shields.io/npm/v/rc-textarea.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-textarea
[github-actions-image]: https://github.com/react-component/textarea/workflows/CI/badge.svg
[github-actions-url]: https://github.com/react-component/textarea/actions
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/textarea/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/react-component/textarea/branch/master
[download-image]: https://img.shields.io/npm/dm/rc-textarea.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-textarea
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-textarea
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-textarea
Pretty Textarea react component used in [ant.design](https://ant.design).
## Live Demo
https://react-component.github.io/textarea/
## Install
[](https://npmjs.org/package/rc-textarea)
## Usage
```js
import Textarea from 'rc-textarea';
import { render } from 'react-dom';
render(, mountNode);
```
## API
| Property | Type | Default | Description |
| ------------ | --------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |
| prefixCls | string | rc-textarea | |
| className | string | '' | additional class name of textarea |
| style | React.CSSProperties | - | style properties of textarea |
| autoSize | boolean \| object | - | Height autosize feature, can be set to `true\|false` or an object `{ minRows: 2, maxRows: 6 }` |
| onPressEnter | function(e) | - | The callback function that is triggered when Enter key is pressed |
| onResize | function({ width, height }) | - | The callback function that is triggered when resize |
## Development
```
npm install
npm start
```
## License
rc-textarea is released under the MIT license.