1.0.2 • Published 7 years ago

react-native-animated-message v1.0.2

Weekly downloads
26
License
MIT
Repository
github
Last release
7 years ago

react-native-animated-message

A message component using animations for react native support for both Android and iOS

Demo

demo

Installation

npm i react-native-animated-message

Example

Check Example.js file in the example folder. Or you can run the built examples step by step as below: 1. Clone the repository:

git clone https://github.com/quocnguyenvan/react-native-animated-message.git
  1. cd to example: cd react-native-animated-message/example
  2. Install dependencies: npm install
  3. Finally, run the apps:
  • iOS:
react-native run-ios
  • Android:
react-native run-android

Usage

import Message from 'react-native-animated-message';

<View style={styles.container}>
  <Button 
    title="Show top"
    onPress={()=> this.message.showMessage('This is a message', 3000)}
  />
  <Message
    ref={(message) => this.message = message }
    animation={'slideX'}
    position={'top'}>
  </Message>
</View>

Method

  • showMessage(message: string, duration: number)

Props

PropDefaultTypeDescription
animationslideXstringAnimation for message (slideX, slideY or zoom)
positiontopstringDetermine the position of message (top, center or bottom)
messageHeight60numberThe height of message
textStyle{color: 'white', fontSize: 16, fontWeight: 'bold', textAlign: 'center'}styleStyle for message text
messageStyle{backgroundColor: 'green'}styleStyle applied to the message

MIT Licensed