The Dark Mode Toggle component provides an easy-to-use button for switching between light and dark themes in your application. It uses the next-themes library for theme management and displays appropriate icons based on the current theme.
page.tsx
Copy
import DarkModeToggle from "@/components/dark-mode-toggle";
You can also set up the initial theme in the configuration file.
import DarkModeToggle from "@/components/dark-mode-toggle";export default function Example() { return ( <div className="flex justify-center items-center h-screen"> <DarkModeToggle /> </div> );}
The Dark Mode Toggle component creates a button that allows users to switch between light and dark themes. It automatically handles the theme change and updates the button’s icon to reflect the current theme.
If you need basic components like buttons, inputs, and more, they are
available with Shadcn UI.