ThemeProvider
ThemeProvider(
props):Element
Defined in: packages/react/src/components/ui/ThemeProvider.tsx:56
Framework-agnostic theme provider.
Manages the .dark class on <html> and persists the user’s preference to
localStorage. Respects the system prefers-color-scheme media query when
theme is set to "system".
Does NOT depend on next-themes — works in any React framework.
Parameters
Section titled “Parameters”object & ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement>
Component props.
Returns
Section titled “Returns”Element
The provider wrapping children with theme context.
Example
Section titled “Example”// Wrap your app root<ThemeProvider> <App /></ThemeProvider>