A little daydream
A smiling sun, passing clouds, and a sleepy moon recreate the supplied interaction.
Component 027Controls
A cheerful sun slips behind the clouds as a sleepy moon brings stars, a nightcap, and a quiet indigo sky.
Quick start
Save day-night-toggle.tsx in your components folder, then import it below. Use it in a Next.js project with Tailwind CSS.
import DayNightToggle from "@/components/ui/day-night-toggle";
export default function Example() {
return <DayNightToggle />;
}Behind the interaction
A smiling sun, passing clouds, and a sleepy moon recreate the supplied interaction.
The stage changes from icy blue daylight to a glowing star-filled night.
Use controlled or uncontrolled state and connect the change callback to your theme.
Keep exploring
A quiet gray ring bursts into a soft blue splash, pulls its droplets together, and draws a crisp white check.
Ten glowing isometric city scenes drawn in SVG, from an office tower and a harbour crane to an airport, a power grid and a night diner. Every figure has its own controls, live status line, and six glow colours in dark or light.
Good morning
Micro-Interactions Daily · Day 1