Install next-themes
First, install the next-themes
package:
Wrap your root layout
Add the ThemeProvider
to your root layout.
Update theme.ts
Update your theme.ts
file to include a getSelector
method.
Add a mode toggle
Place a mode toggle on your site to toggle between light and dark mode.
Create a theme provider
Wrap your root layout
Update theme.ts
Update your theme.ts
file to include a getSelector
method.
Add a mode toggle
Place a mode toggle on your site to toggle between light and dark mode.