All Projects → iamhosseindhv → Notistack

iamhosseindhv / Notistack

Licence: other
Highly customizable notification snackbars (toasts) that can be stacked on top of each other

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Notistack

React Toast Notifications
🍞 A toast notification system for react
Stars: ✭ 2,103 (-17.92%)
Mutual labels:  notifications, toast, snackbar, toast-notifications
Noty
A simple library for creating animated warnings/dialogs/alerts for Android.
Stars: ✭ 136 (-94.69%)
Mutual labels:  material-design, toast, snackbar
Android Iconics
Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
Stars: ✭ 4,916 (+91.88%)
Mutual labels:  material-design, material-ui, google-material
Material Admin
Free Material Admin Template
Stars: ✭ 219 (-91.45%)
Mutual labels:  material-design, material-ui, google-material
React Hot Toast
Smoking hot React Notifications 🔥
Stars: ✭ 4,282 (+67.14%)
Mutual labels:  notifications, snackbar, toast-notifications
bs5-utils
A JavaScript utility package for Bootstrap 5 components.
Stars: ✭ 26 (-98.99%)
Mutual labels:  toast, snackbar, toast-notifications
SteamAchievementNotifier
Steam Achievement Notifier is an Electron application that shows a customisable notification when you unlock any Steam Achievement! It uses the Steam Web API to track achievement stats in real time, and displays an achievement summary within the notification.
Stars: ✭ 77 (-96.99%)
Mutual labels:  notifications, toast, toast-notifications
tall-toasts
A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS 🔥🚀
Stars: ✭ 296 (-88.45%)
Mutual labels:  notifications, toast, toast-notifications
Demo Progressive Web App
🎉 A demo for progressive web application with features like offline, push notifications, background sync etc,
Stars: ✭ 798 (-68.85%)
Mutual labels:  notifications, material-design, snackbar
Blazormaterial
Blazor components implementing Google's Material components for web - https://material.io/components/web
Stars: ✭ 136 (-94.69%)
Mutual labels:  material-design, material-ui
Toastutils
Android 吐司框架,专治 Toast 各种疑难杂症
Stars: ✭ 2,087 (-18.54%)
Mutual labels:  toast, toast-notifications
Generator Jhipster React
DEPRECATED: feature moved to main generator
Stars: ✭ 155 (-93.95%)
Mutual labels:  material-design, material-ui
Dynamic Toasts
Custom toasts with color and icon for Android.
Stars: ✭ 132 (-94.85%)
Mutual labels:  material-design, toast
Devextreme Reactive
Business React components for Bootstrap and Material-UI
Stars: ✭ 1,800 (-29.74%)
Mutual labels:  material-design, material-ui
Todayx
🌈Flutter App:🎊「今日份的X」(每天推荐一个:图片、诗歌、名言、音乐、乐评、高等数学、两种配色、化学方程式、Github Repo、知乎问题、文章)
Stars: ✭ 128 (-95%)
Mutual labels:  material-design, material-ui
React Native Snackbar Component
A snackbar component for Android and iOS
Stars: ✭ 137 (-94.65%)
Mutual labels:  material-design, snackbar
Notyf
👻 A minimalistic, responsive, vanilla JavaScript library to show toast notifications.
Stars: ✭ 2,093 (-18.31%)
Mutual labels:  notifications, toast
Material.avalonia
Material design in AvaloniaUI
Stars: ✭ 126 (-95.08%)
Mutual labels:  material-design, google-material
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (-94.65%)
Mutual labels:  material-design, material-ui
Material
A UI/UX framework for creating beautiful applications.
Stars: ✭ 11,870 (+363.31%)
Mutual labels:  material-design, snackbar

notistack logo

Notistack is a notification library which makes it extremely easy to display notifications on your web apps. It is highly customizable and enables you to stack snackbars/toasts on top of one another.
Visit documentation website for demos.

npm version npm downloads package license

Stacking behaviour Dismiss oldest when reached maxSnack (3 here)

Table of Contents

Getting Started

Use your preferred package manager:

npm install notistack
yarn add notistack

If you're using Material-UI version 4.x.x or lower, download a compatible version of notistack using:

npm install notistack@latest-mui-v4
yarn add notistack@latest-mui-v4

How to use

1: Wrap your app inside a SnackbarProvider component: (see docs for a full list of available props)
Note: If you're using material-ui ThemeProvider, make sure SnackbarProvider is a child of it.

import { SnackbarProvider } from 'notistack';

<SnackbarProvider maxSnack={3}>
    <App />
</SnackbarProvider>

2: Export any component that needs to send notification using withSnackbar. By doing this, you'll have access to methods enqueueSnackbar and closeSnackbar, where the former can be used to send snackbars.

import { withSnackbar } from 'notistack';

class MyComponent extends Component {
  handleNetworkRequest = () => {
     fetchSomeData()
        .then(() => this.props.enqueueSnackbar('Successfully fetched the data.'))
        .catch(() => this.props.enqueueSnackbar('Failed fetching data.'));
  };

  render(){
     //...
  };

};

export default withSnackbar(MyComponent);

2 (alternative): You can use useSnackbar hook in your functional components as well.

import { useSnackbar } from 'notistack';

const MyButton = () => {
    const { enqueueSnackbar, closeSnackbar } = useSnackbar();

    const handleClick = () => {
        enqueueSnackbar('I love hooks');
    };

    return (
        <Button onClick={handleClick}>Show snackbar</Button>
    );
}

Online demo

Visit documentation website to see all the demos.
Or play with a minimal working example: codesandbox

Redux and Mobx support:

notistack is compatible with state management libraries such as Redux and Mobx. See notistack documentation for more info.

Contribution

Open an issue and your problem will be solved.

Author - Contact

Hossein Dehnokhalaji

Hossein Dehnokhalaji Instagram profile Hossein Dehnokhalaji Linkedin profile Hossein Dehnokhalaji email address

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].