- Applies theme via class attribute on the root element (for Tailwind
dark:prefix) - Defaults to system to respect OS preference
- Persists user preference in localStorage
- Prevents flash of wrong theme on load
Props
React.ReactNode
required
children
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Wraps the application with next-themes for dark mode support
dark: prefix)import { ThemeProvider } from '@/components/ThemeProvider';
export default function Example() {
return (
<ThemeProvider>
<App />
</ThemeProvider>
);
}