Skip to content

A lightweight, customizable, and accessible toast component that makes notifications in your React app delightful.

License

Notifications You must be signed in to change notification settings

mosespace/mtoast

Usage

To start using the library, install it in your project:

npm install @mosespace/toast@latest

add the following to your tailwind.config.ts

  content: [
    ...
    './node_modules/@mosespace/toast/**/*.{js,ts,jsx,tsx}', // Include this line
  ],

Add <Toaster /> to your app, it will be the place where all your toasts will be rendered. After that you can use toast() from anywhere in your app.

import { Toaster, toast } from '@mosespace/toast';

// ...

function App() {
  return (
    <div>
      <Toaster />
      <button onClick={() => toast.success('My first toast')}>
        Give me a toast
      </button>
    </div>
  );
}

Documentation

Find the full API reference in the documentation.

About

A lightweight, customizable, and accessible toast component that makes notifications in your React app delightful.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published