@walruship/toastify
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

Toastify

Toastify allows you to add notifications to your app with ease. No more nonsense!

Features

  • Maximum snackbars.
  • Hide duration.
  • Dismiss programmatically.
  • Prevent duplicate.
  • Easy customization.
  • And much more !

Quick Setup

Use your preferred package manager:

$ npm install --save @walruship/toastify
$ yarn add @walruship/toastify

How to use

Instantiate a SnackbarProvider component and start showing snackbars: (see docs for a full list of available props)

import { SnackbarProvider, enqueueSnackbar } from '@walruship/toastify';

const App = () => {
  return (
    <div>
      <SnackbarProvider />
      <button onClick={() => enqueueSnackbar('That was easy!')}>Show snackbar</button>
    </div>
  );
};

Alternatively, You can use useSnackbar hook to display Snackbars. Just remember to wrap your app inside of a SnackbarProvider to have access to the hook context:

import { SnackbarProvider, useSnackbar } from '@walruship/toastify';

<SnackbarProvider>
  <App />
  <MyButton />
</SnackbarProvider>;

const MyButton = () => {
  const { enqueueSnackbar, closeSnackbar } = useSnackbar();
  return <Button onClick={() => enqueueSnackbar('I love hooks')}>Show snackbar</Button>;
};

Documentation

Check the documentation to get you started!

Security

  • If you discover any security related issues, please email 286.trants@gmail.com instead of using the issue tracker.

License

Package Sidebar

Install

npm i @walruship/toastify

Weekly Downloads

1

Version

3.0.1

License

BSD-3-Clause

Unpacked Size

525 kB

Total Files

11

Last publish

Collaborators

  • walruship