A simple toast notification library for React Native and Expo Compactible.
npm install @originaltimi/rn-toast
yarn add @originaltimi/rn-toast
import toast, { ToastProvider } from '@originaltimi/rn-toast';
// ...
<ToastProvider
config={{
position: 'bottom',
duration: 5000,
stack: true,
}}
>
<App />
</ToastProvider>
// ...
const clickHandler = () =>{
toast({
title:'Hello, World!'
type: 'success'
});
}
Displays a toast notification.
title
(string): The message to display in the toast.duration
(number): Duration in milliseconds for which the toast is visible.position
(string): Position of the toast on the screen (top
,bottom
).type
(string): Type of the toast (success
,error
,info
).stack - Coming Soon
(boolean)
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT