React Native Toast component for both Android and iOS. It just let iOS have the same toast performance with Android. Using scalessec/Toast for iOS;
You can use rnpm to install native component easily;
npm install react-native-simple-toast --save
rnpm link
It's just the same as ToastAndroid
import Toast from 'react-native-simple-toast';
Toast.show('This is a toast.');
Toast.show('This is a long toast.',Toast.LONG);
Toast was been able to make customizable through these properties
{
width:300,
height:50,
backgroundColor: "#C2F8FF",
color: "#ffffff",
borderWidth: 3,
borderColor: "#C2F8FF",
borderRadius: 3
}
if you want to make a customizable toast,you add an object like above to show
and showGravity
import Toast from 'react-native-simple-toast';
const style={
width:300,
height:50,
backgroundColor: "#C2F8FF",
color: "#ffffff",
borderWidth: 3,
borderColor: "#C2F8FF",
borderRadius: 3
};
Toast.show('This is a long toast.',Toast.LONG,style);
Toast.showWithGravity(message, Toast.SHORT,Toast.TOP,style)
These are properties that can make customizable
width
,
height
,
backgroundColor
,
color
,
borderColor
,
borderWidth
You can make customizable all of them or some of them or you can use default toast style.