2.0.0 • Published 10 years ago
react-native-notification v2.0.0
react-native-notification
Customizable toast-like notifications for React Native

Install
$ npm install react-native-notificationUsage
import React, { Component, View, Text, TouchableOpacity, StyleSheet } from 'react-native';
import Notification from 'react-native-notification';
class MyComponent extends Component {
constructor() {
this.state = {
message: '',
};
}
onPress = () => {
this.setState({
message: 'Hi there',
});
};
render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress={this.onPress}>
<Text style={styles.text}>Tap me!</Text>
</TouchableOpacity>
<Notification message={this.state.message} />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
text: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
export default MyComponent;Customization
The styles of the notification are exposed as Notification.styles. The container property describes the notification container (by default the rounded gray-ish rectangle) and the message property the message itself (the white color text).
What may be in store for future versions
- Allow message as
props.childrenallowing other components to be part of the message - More unit tests
License
MIT (See LICENSE)
2.0.0
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago
1.0.0-alpha4
10 years ago
1.0.0-alpha3
10 years ago
1.0.0-alpha2
10 years ago
1.0.0-alpha1
10 years ago