Toast
A succinct message that is displayed temporarily.
Usage
First, import and add the Toaster
component to your app's root layout.
Then, import the toast
function that displays toasts when called:
Default
Intent
Close button
With action
To add an action to the toast, pass in a Button
element to the action
prop. Note that action
takes in any React node, but it is intended to be a Button
element that triggers some relevant action.
Alternatively, an object of type { label: string; onClick: (event: MouseEvent<HTMLButtonElement, MoustEvent>) => void }
may be passed in.