Dark Mode
Follow this comprehensive guide to add dark mode support to your project using VizStats UI components. Our implementation is based on the shadcn/ui approach, providing a seamless and customizable dark mode experience.
Prerequisites
Ensure you have VizStats UI installed in your project. If not, follow the installation guide.
Adding Dark Mode Support
Set Up the Theme Provider
Create a new file called theme-provider.tsx in your components directory:
components/theme-provider.tsx
Then, wrap your app with the ThemeProvider in your layout.tsx file:
Create a Theme Toggle
Create a new component called theme-toggle.tsx in your components directory:
components/theme-toggle.tsx
Now, you can easily toggle between light and dark modes using the ThemeToggle component in your UI.
Use the Theme Toggle
In your UI, you can use the ThemeToggle component to toggle between light and dark modes: