Getting Started
Install with Yarn
yarn add react-stacked-toast
Install with NPM
npm install react-stacked-toast
Quick usage
1. Add the Toaster
component to your application
import { Toaster } from 'react-stacked-toast';
const App = () => {
return (
<Toaster />
);
};
2. Use the toast
api to create a toast anywhere in your application
import { toast } from 'react-stacked-toast';
const Component = () => {
const handleClick = () => {
toast("Here is your toast");
toast({
title: 'React Stacked Toast',
description: 'Here is your toast!',
icon: '🍞'
...
});
}
return (
<button
onClick={handleClick}
>
Show toast
</button>
);
};