Sonner
A non-intrusive, auto-dismissable notification component used to display brief status updates, alerts, or confirmation messages.
Installation
CLI
Manual
First, in your root app component or layout, import the Toast component.
import { Toast } from '@/components/ui'
const Layout = ({ children }: { children: React.ReactNode }) => {
return (
<>
<Toast />
{children}
<>
)
}
Basic
Use the toast()
function to show a toast.
View
Code
Description
View
Code
Status
View
Code
Action
View
Code
Manually Close
Just pass the timeout: 0
option.
View
Code