Created
March 12, 2025 16:37
-
-
Save Xeven777/bfe0f5313d6fd3500449094b3ea3610e to your computer and use it in GitHub Desktop.
Toaster With Theme support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client'; | |
import { useTheme } from 'next-themes'; | |
import { Toaster } from '@/components/ui/sonner'; | |
const ToasterwithTheme = () => { | |
const { theme } = useTheme(); | |
return ( | |
<Toaster | |
richColors | |
closeButton | |
theme={theme === 'dark' ? 'dark' : 'light'} | |
/> | |
); | |
}; | |
export default ToasterwithTheme; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment