ui
ui copied to clipboard
sonner component ts error on attribute classnames
after I installed the sonner component I'm getting this typescript error
as you can see the classNames attribute is not even recognized.
Hi Mohamed! Probably you aren't accessing to the Toaster props as expected, here is an example of customizing Toaster classNames:
<Toaster
toastOptions={{
classNames: {
toast:
'group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg',
description: 'group-[.toast]:text-muted-foreground',
actionButton:
'group-[.toast]:bg-primary group-[.toast]:text-primary-foreground',
cancelButton:
'group-[.toast]:bg-muted group-[.toast]:text-muted-foreground',
},
}}
/>
Hope it can help you!
It worked thanks!!