Toast

An opinionated toast component for React.

Preview

Installation

$npx maddex add Toast

Usage

1<!-- @import { toast } from ../../lib/hooks -->
2<!-- @import { Button } from ../../lib/components -->
3
4<Button
5  variant="outline"
6  onclick="toast('Event has been created', {
7    description: 'Sunday, December 03, 2023 at 9:00 AM',
8    action: {
9      label: 'Undo',
10      onClick: () => console.log('Undo'),
11    },
12  })"
13>
14  Show Toast
15</Button>