1.0.0 • Published 5 years ago

rn-basic-toast v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

rn-toast

A react native simple toast module to show animated or default types of toast in android and iOS.

Installation

  • 1.Run npm i rn-toast --save or yarn add rn-toast
  • 2.import Toast from 'rn-toast'

Demo

Example

import Toast, { ToastContainer } from 'rn-toast'

Use Toast method to show toast

Toast({
  message : "Hii this is  test Toast!",
  delay : 5000
})

or use toast as a container with ToastContainer anywhere inside the component

<ToastContainer message="Hii this is  test Toast" delay={5000} />

Props

PropsTypeOptionalDefaultDescription
messagestringfalsetoast message
delaynumbertrue3000toast delay duration
positionstring, one of ('top','bottom')truebottomtoast position
typestring one of ('default','wide')truedefaulttype of toast
animationstring one of ('slideUpDown','slideRight', slideLeft)trueslideUpDown*only for type 'wide'
backgroundstringtrue'#121010'toast background color
borderRadiusnumbertrue100border radius ( default 0 for type wide)
textStylestyletrue{ color:'#8ad2ff' }custom style text
buttonobjecttrue{}to show button on toast ex. { titile : "button", onpress=()=>{}, background : "#8ad2ff", borderRadius : 5, textStyle : {} }

Contribution

Issues and Pull requests are welcome.