3.0.15 • Published 12 months ago
@mosespace/toast v3.0.15
Usage
To start using the library, install it in your project:
npm install @mosespace/toast@latestadd 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.