Wraps the application in Next.js theme context, exposing the current theme and allowing the user to switch between dark, light and system.
<ThemeProvider> <Page>{children}</Page> </ThemeProvider> Copy
<ThemeProvider> <Page>{children}</Page> </ThemeProvider>
The component tree to provide the theme to.
export default function ThemeProvider({ children }: { children: ReactNode }) { return ( <NextThemeProvider attribute="class" defaultTheme="system" enableSystem> {children} </NextThemeProvider> );} Copy
export default function ThemeProvider({ children }: { children: ReactNode }) { return ( <NextThemeProvider attribute="class" defaultTheme="system" enableSystem> {children} </NextThemeProvider> );}
Wraps the application in Next.js theme context, exposing the current theme and allowing the user to switch between dark, light and system.
Example