Uses next-themes with system default. Toggle button in sidebar switches between light/dark and persists to localStorage. CSS variables for dark mode were already defined in globals.css. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
12 lines
322 B
TypeScript
12 lines
322 B
TypeScript
'use client'
|
|
|
|
import { ThemeProvider as NextThemesProvider } from 'next-themes'
|
|
|
|
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<NextThemesProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>
|
|
{children}
|
|
</NextThemesProvider>
|
|
)
|
|
}
|