Atoms
Sonner
Toast notification component.
shadcn/uiBased on shadcn/ui with Formance brand styling.
Installation#
npx shadcn@latest add @formance/sonnerInstall the following dependencies:
npm install sonner next-themesCopy and paste the following code into your project.
Add the SonnerToaster component to your root layout.
import { SonnerToaster } from '@/components/ui/sonner'
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<SonnerToaster />
</body>
</html>
)
}Usage#
import { toast } from 'sonner'toast('Transaction recorded')
toast.success('Payment processed')
toast.error('Transfer failed')
toast.warning('Low balance')
toast.info('Connector syncing')