1.0.7 • Published 13 days ago

@smak021/react-native-toast v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
13 days ago

React Native Toast

runs with expo

A react native custom toast message viewer .

With logoLarge message
Toast with iconLarge toast message

Usage

import Toast,{ ToastProvider } from '@smak021/react-native-toast'

function App(){
    return(
        <ToastProvider>
        // ...Your code goes here
            <Toast duration={3000}  backgroundColor={'#33333'}/>
        </ToastProvider>
    )
}

Set toast message in other components using the useToast() hook:

import { useToast } from '@smak021/react-native-toast'

function Component(){

    const { setToastMessage } = useToast()

    const handleError=()=>{
        setToastMessage('Your Toast Message')
    }

    return(
        //..UI
    )
}

Props

PropertyDescriptionDefault Value
duration (in milliseconds)The amount of time the toast component is visible2000
typeCompact or modernmodern
toastIcon(only for modern) Custom icon used in the toastnull
marqueeDuration (in milliseconds)(only for modern) The amount of time required for the text message to complete the marquee animation3500
marqueeDelay (in milliseconds)(only for modern) The delay between each text animation500
backgroundColorToast background color#333333
showButton(only for compact) Shows a button next to message-
onPress(only for compact) Function for managing the button press-
buttonDisabled(only for compact) Disables the buttonfalse
buttonText(only for compact) Text rendered on the buttonOK
showButton(only for compact) For activating the buttonfalse
textLeft(only for compact) Align text to the leftfalse
onAnimationEndFunction, which execute after toast is closed-
1.0.7

13 days ago

1.0.2

16 days ago

1.0.6

16 days ago

1.0.5

16 days ago

1.0.4

16 days ago

1.0.3

16 days ago

1.0.1

7 months ago

1.0.0

7 months ago