1.1.2 • Published 5 years ago

react-native-toast-notification v1.1.2

Weekly downloads
14
License
MIT
Repository
github
Last release
5 years ago

react-native-toast-notification

A react native component for toast message

License MIT

Installation

  • 1.Run npm i react-native-toast-notification --save or yarn add react-native-toast-notification
  • 2.import ToastNotification from 'react-native-toast-notification'

Screenshots

Getting started

Add react-native-easy-toast to your js file.

import ToastNotification from 'react-native-toast-notification'

Inside your component's render method, use ToastNotification:

 render() {
         return (
             <ToastNotification
                textStyle={{ color: 'red' }}
                style={{ backgroundColor: 'yellow' }}
                text="Hello World!"
                duration={2000}
                onHide={this._handleOnHideToastNotification}
             />
         );
 }

API

PropsTypeOptionalDefaultDescription
styleobjecttrueGray background etc.Custom style toast
isTopbooleantruefalseCustom toast position
positionValuenumbertrue100Custom toast position value
durationnumbertrue2000Custom toast animation duration
textStylestyletruewhite color etc.Custom style text
onPressfunctiontruenullFor handle on press
onHidefunctiontruenullFor handle on hide

MIT Licensed UE