Mbompr / react-native-mentions

Mentions textbox for React Native. Works on both ios and android. :tropical_fish: :whale:

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-mentions npm version

Mentions textbox for React Native. Works on both ios and android.

alt text

Installation

npm install --save react-native-mentions

Usage

import {MentionsTextInput} from 'react-native-mentions';

<MentionsTextInput
 textInputStyle={{ borderColor: '#ebebeb', borderWidth: 1, padding: 5, fontSize: 15 }}
 textInputMinHeight={35}
 textInputMaxHeight={85}
 returnKeyType={'send'}
 trigger={'@'}
 value={this.state.value}
 onChangeText={(val) => { this.setState({ value: val }) } }
 suggestionsPanelHeight={45}
 renderSuggestionsRow={this.renderSuggestionsRow.bind(this)}
 suggestionsPanelStyle={{ backgroundColor: 'rgba(100,100,100,0.1)' }}
 suggestionsDataSource={this.state.ds}
 triggerCallback={this.callback.bind(this)}
 onKeyPress={(e) => { e.nativeEvent.key == "Enter" ? console.log("ENTER") : false } } 
/>

Example

Check full example in the sampleApp folder.

License

MIT License. © Harshana Abeyaratne

About

Mentions textbox for React Native. Works on both ios and android. :tropical_fish: :whale:

License:MIT License


Languages

Language:JavaScript 62.5%Language:Objective-C 22.2%Language:Python 8.3%Language:Java 7.0%