fancy-snackbars
v1.10.0
Published
Manage a queue of customised Material-UI snackbars.
Downloads
10
Readme
Fancy Snackbars
Fancy Snackbars manages a queue of Material-UI Snackbar notifications. Multiple notifications are queued and shown one after another.
How to Use
1. Wrap your app inside a SnackbarProvider
component.
import { FancySnackbarProvider } from "fancy-snackbars";
<FancySnackbarProvider>
<App />
</FancySnackbarProvider>;
2. Use useFancySnackbar
hook in your functional components.
import { useFancySnackbar } from "fancy-snackbars";
const MyButton = () => {
const { queueFancySnackbar } = useFancySnackbar();
const handleClick = () => {
queueFancySnackbar("My message", "info");
};
return <button onClick={handleClick}>Show Fancy Snackbar</button>;
};
Example App
To install packages run:
npm install
To run the app in the development mode.
npm start
Open http://localhost:3000 to view it in the browser.