# react-native-textarea

> React Native textarea component

Latest version **1.0.4** (published 2020-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-textarea
pnpm add react-native-textarea
yarn add react-native-textarea
bun add react-native-textarea
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-04-29 |
| First published | 2018-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Leo Xin |
| Maintainers | xinlc |
| Keywords | textarea, react-native-textarea, react-native, react-component |

## Links

- npm: https://www.npmjs.com/package/react-native-textarea
- Repository: https://github.com/xinlc/react-native-textarea
- Issues: https://github.com/xinlc/react-native-textarea/issues
- npm.io page: https://npm.io/package/react-native-textarea

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.0.4 (latest) — 2020-04-29
- 1.0.3 — 2019-03-01
- 1.0.2 — 2018-07-13
- 1.0.1 — 2018-05-30
- 1.0.0 — 2018-04-11

## README

English | [简体中文](./README.zh-CN.md)

# react-native-textarea

[![npm package](https://img.shields.io/npm/v/react-native-textarea.svg?style=flat-square)](https://www.npmjs.org/package/react-native-textarea)
[![npm downloads](https://img.shields.io/npm/dt/react-native-textarea.svg)](https://www.npmjs.com/package/react-native-textarea)
[![build](https://img.shields.io/travis/xinlc/react-native-textarea.svg?style=flat-square)](https://travis-ci.org/xinlc/react-native-textarea)

React Native textarea component

## Example

![](./docs/ios.png)
![](./docs/android.jpg)

## Installation

1. Install package via npm:

```bash
$ npm install --save react-native-textarea
```

2. Include the library in your code:

```js
import Textarea from 'react-native-textarea';
```

3. Use the component:

```js
...
<View style={styles.container}>
  <Textarea
    containerStyle={styles.textareaContainer}
    style={styles.textarea}
    onChangeText={this.onChange}
    defaultValue={this.state.text}
    maxLength={120}
    placeholder={'好玩有趣的，大家同乐，伤感忧闷的，大家同哭。。。'}
    placeholderTextColor={'#c7c7c7'}
    underlineColorAndroid={'transparent'}
  />
</View>
...

const styles = StyleSheet.create({
  container: {
    flex: 1,
    padding: 30,
    justifyContent: 'center',
    alignItems: 'center',
  },
  textareaContainer: {
    height: 180,
    padding: 5,
    backgroundColor: '#F5FCFF',
  },
  textarea: {
    textAlignVertical: 'top',  // hack android
    height: 170,
    fontSize: 14,
    color: '#333',
  },
});
```

## API

### Textarea

Properties | Descrition | Type | Default
-----------|------------|------|--------
| maxLength  |  limits the maximum number of characters that can be entered  | number   | `0` |
| containerStyle |  custom style  | Object  | - |

> More available `Textarea` API can be found at [react-native TextInput](http://facebook.github.io/react-native/docs/textinput.html)

---
_Source: https://npm.io/package/react-native-textarea · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
