Giter Site home page Giter Site logo

gouravd / react-native-mentions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from harshq/react-native-mentions

0.0 1.0 0.0 3.53 MB

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

License: MIT License

JavaScript 100.00%

react-native-mentions's Introduction

react-native-mentions npm version

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

Demo

alt text alt text

Installation

yarn add react-native-mentions or npm install --save react-native-mentions

Usage

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

  <MentionsTextInput
    textInputStyle={{ borderColor: '#ebebeb', borderWidth: 1, padding: 5, fontSize: 15 }}
    suggestionsPanelStyle={{ backgroundColor: 'rgba(100,100,100,0.1)' }}
    loadingComponent={() => <View style={{ flex: 1, width, justifyContent: 'center', alignItems: 'center' }}><ActivityIndicator /></View>}
    textInputMinHeight={30}
    textInputMaxHeight={80}
    trigger={'@'}
    triggerLocation={'new-word-only'} // 'new-word-only', 'anywhere'
    value={this.state.value}
    onChangeText={(val) => { this.setState({ value: val }) }}
    triggerCallback={this.callback.bind(this)}
    renderSuggestionsRow={this.renderSuggestionsRow.bind(this)}
    suggestionsData={this.state.data} // array of objects
    keyExtractor={(item, index) => item.UserName} 
    suggestionRowHeight={45}
          
    horizontal={false} // defaut is true, change the orientation of the list
    MaxVisibleRowCount={3} // this is required if horizontal={false}
  />

Example

Check full example in the sampleApp folder.

Breaking changes ( 0.0.4 -> 1.1.1 )

  • This library now supports RN 0.47 and above due to this. If you're on a older version, use react-native-mentions 0.0.4. Check the example here

  • SuggestionsDataSource prop is renamed to suggestionsData. This now accepts a array of objects. DataSource, No more!

  • SuggestionsPanelHeight prop is renamed to suggestionRowHeight in order to support vertical lists.

License

MIT License. © Harshana Abeyaratne

react-native-mentions's People

Contributors

harshq avatar parrryy avatar pi-chan avatar

Watchers

das_vicky avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.