rn-simple-toast
React Native Toast component for both iOS and Android
Add it to your project
- Insall package
- Using NPM
npm i -S rn-simple-toast
- Using Yarn
yarn add rn-simple-toast
- Using NPM
- Import package
import { Toast, DURATION, POSTION } from 'rn-simple-toast';
Usage
;;Component { return <View style=stylescontainer> <Toast ref= thistoastRef = _ref /> <Button onPress= { toastRef; } title='Show message' style= width: 120 backgroundColor: 'darkviolet' textColor='#fff' /> </View> ; }
DEMO
Props
duration
(String) - Duration time to display message.containerStyle
(String) Style of toast container.textStyle
(Function) - Style of text messageposition
(String) - Message display positionpositionOffset
(String) - Distance from top or bottom to display message
Method
show
- The method to show toast message
MIT Licensed