Catalogue
Day / Night Toggle, preview

Live. Click, drag or type.

Click the sun and it sets: the knob rolls across and turns into a cratered moon, clouds drop away, stars fall in on a stagger and the page switches theme. Plain HTML/CSS/JS file plus a React version.

Install

  1. One commandnpx shadcn@latest add https://teodoravadani.github.io/qodesign-free/r/day-night-toggle.json
  2. Or ask your AIPaste PROMPT.md into Cursor, Lovable or v0.

What it does

  • Sun → moon morph with craters
  • Clouds + staggered stars
  • Keyboard accessible (button + aria-pressed)
Stack
React · HTML version
Released
Licence
Free and open source (MIT). GitHub

Using Cursor, v0 or Lovable?

How do I add Day / Night Toggle to a Next.js app I build with Cursor?

Run npx shadcn@latest add https://teodoravadani.github.io/qodesign-free/r/day-night-toggle.json in the project. The file already starts with "use client", so it works in the App Router. Then open the agent chat and paste the first prompt from the PROMPT.md that comes with it: Cursor reads the component and fits it to your data, colors and file layout instead of rewriting it.

Does Day / Night Toggle work in v0?

Yes. Install it in your v0 project with the same shadcn command, or paste the component source into the chat. Then paste the first prompt from PROMPT.md so v0 wires it into your page and keeps the animation as it is.

Can I use Day / Night Toggle in a Lovable project?

Yes. Lovable apps are React, TypeScript and Tailwind, the same stack as the React version. Sync the project to GitHub and add the file there, or paste the source into the Lovable chat and ask it to add the component, then paste the first prompt from PROMPT.md.

Can I try it before I add it?

Yes. The preview at the top of this page is the real component running, not a video. It is free, and the free kit at qodesign.dev/free adds more pieces and copy-paste prompts for Cursor, v0 and Lovable for an email.

Step by step: Cursor, v0, Lovable. Start free: the free kit

Reviews

No reviews yet for this piece.

Only people who got it can review it: the order email has a rating link, one review per order.

Keep browsing

Liquid Glass Tab Bar, animated preview

A glass drop magnifies the tab under it, stretches between tabs and bursts into the player.

Spotlight Lamp Login, animated preview

A sign-in page in the dark: a desk lamp finds each field and floods the screen when you sign in.

Step-Up OTP Gate, animated preview

Arcs spin around six chunky cells, merge into one check, and the blurred dashboard behind them unlocks.

Stack Cart Drawer, animated preview

Products fly into the cart as discs; open it and they unfold into line items.

Prompt Bloom, animated preview

An AI chat composer: the prompt lifts into a message and the answer card blooms out of the input.