Base Components
Toast
Multiple notifications may stack up as Toasts, delivering brief feedback in a compact size.
This component is intended to be used with the <Alert>
component. Refer to the Alert documentation for setup instructions before using this component.
Install the following dependencies:
terminal
npm install sonner
Create a toast.tsx
file and paste the following code into it.
/components/ui/toast.tsx
Create a components/ui/toast-alert.tsx
file and paste the following code into it.
Add the Toaster
component in layout.tsx
:
/app/layout.tsx
Update the import paths to match your project setup.
Examples
Non-dismissable
Sonner Options
API Reference
This component is based on the Sonner package. Refer to their documentation for the API reference.
© 2024 AlignUI Design System. All rights reserved.