React Native Toast component for both iOS and Android
npm install rn-simple-toast1. Insall package
- Using NPM
npm i -S rn-simple-toast
- Using Yarn
yarn add rn-simple-toast
2. Import package
import { Toast, DURATION, POSTION } from 'rn-simple-toast';
``javascript`
import React from 'react';
import { Toast, DURATION } from 'rn-simple-toast';
class App extends React.Component {
render() {
return (
onPress={() => {
toastRef.show('Some message here', '#3498db', DURATION.LONG);
}}
title='Show message'
style={{ width: 120, backgroundColor: 'darkviolet' }}
textColor='#fff'
/>
);
}
}
- duration _(String)_ - Duration time to display message.
- containerStyle _(String)_ Style of toast container.
- textStyle _(Function)_ - Style of text message
- position _(String)_ - Message display position
- positionOffset _(String)_ - Distance from top or bottom to display message
MIT Licensed