ui icon indicating copy to clipboard operation
ui copied to clipboard

sonner component ts error on attribute classnames

Open elguarir opened this issue 1 year ago • 1 comments

after I installed the sonner component I'm getting this typescript error

image

image

as you can see the classNames attribute is not even recognized.

elguarir avatar Jan 15 '24 19:01 elguarir

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!

franfares10 avatar Jan 15 '24 20:01 franfares10

It worked thanks!!

elguarir avatar Jan 16 '24 18:01 elguarir