Theme Toggle
A smooth animated theme switcher using next-themes and Framer Motion.
Installation
Props
Usage
1"use client";2 3import ThemeToggle from "@/components/ui/theme-toggle";4 5export default function Page() {6 return (7 <div className="flex min-h-screen items-center justify-center bg-neutral-100 dark:bg-neutral-900">8 <ThemeToggle />9 </div>10 );11}
Features
- Works with next-themes provider
- Framer Motion animations for smooth transitions
- Icons morph, rotate, and fade between states
- Full light/dark mode support
- Accessible with aria-label