Create project
Run the init
command to create a new Next.js project or to setup an existing one:
You will be asked a few questions to configure components.json
:
Install next-themes
Create a theme provider
Wrap your root layout
Add the ThemeProvider
to your root layout.
Add a mode toggle
Place a mode toggle on your site to toggle between light and dark mode.
That's it
You can now start adding components to your project.