Day / night theme toggle
The sun rolls into a moon, clouds fall away and stars drop in. Free.
The sun rolls into a moon, clouds fall away and stars drop in. Free.
"use client";
import DayNightToggle from "@/components/day-night-toggle/DayNightToggle";
export default function ThemeSwitch() {
return <DayNightToggle width={120} onChange={(night) => document.documentElement.classList.toggle("dark", night)} />;
}npx shadcn@latest add https://teodoravadani.github.io/qodesign-free/r/day-night-toggle.jsonYes, as a client component. Keep "use client" at the top of the file that renders it, as in the snippet above. App Router and Pages Router both work.
Yes. Call setTheme inside onChange.
Yes. MIT licence, no email needed for the registry install.
Yes. The folder has a PROMPT.md. Paste it into Cursor, Lovable, v0 or Claude Code.
All comparisons, with prices read on each library's own site.