Checkbox & toggles
Day Night Switch
A day/night theme switch: the track repaints from daylight sky to night, the sun turns into a crescent, and stars rise beside it.
React + Tailwind, shadcn-compatible: press “Copy for AI” and your Cursor or Claude Code agent installs it with the shadcn CLI.
What you can change
- the light mode caption through dayLabel
- the dark mode caption through nightLabel
- the hint under the mode name through hint
A link for your AI agent: preview, code and instructions.
Preview

Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.club/c/switch-009?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
How to use
<Switch009
dayLabel="Light theme"
nightLabel="Dark theme"
/>A sample call. The agent installs the component itself from the registry via the “Copy for AI” link.
Settings
- Light mode
dayLabel· default: Light theme- Dark mode
nightLabel· default: Dark theme- Hint
hint· default: Switched manually- Night
defaultChecked· default: off- Accent
accent· default: theme colour- Background
background· default: theme colour
More in Checkbox & toggles
FAQ
- How do I add Day Night Switch with Cursor or Claude Code?
- Press “Copy for AI” on this page and paste it into your agent's chat. The instruction contains the shadcn CLI install command, the dependencies and what to keep, so the agent installs this exact component instead of recreating a lookalike.
- What does Day Night Switch depend on?
- No npm packages beyond React and Tailwind CSS.
- What can I change in Day Night Switch?
- Adapt: the light mode caption through dayLabel; the dark mode caption through nightLabel; the hint under the mode name through hint. Keep as installed: the local --vibeui-switch-009-* palette — do not swap it for your theme tokens; the crescent cut by a circle in the night-sky colour: change the track background and that circle must change with it; the stars as a single dot with three shadows — decoration does not need three extra nodes.
- Is Day Night Switch free?
- Yes. The preview is open without an account; with a free account you can copy up to 20 components a month.
For developers
npx shadcn@latest add https://vibeui.club/r/pro/switch-009.jsonThis command needs a signed link: sign in and open “Component source” below — it issues a working link valid for 30 minutes. All install options
Technical notes
A server component: all the state is held by a native checkbox with role="switch". The crescent is made by a cut-out — a circle in the night-sky colour on a pseudo-element rides over the sun, and by day it is moved beyond the thumb. The stars are drawn as a single dot with three shadows in box-shadow and are revealed by the input:checked ~ [data-part=stars] rule. The mode caption is switched through :has(input:checked). All the transitions are suppressed by prefers-reduced-motion. The palette lives in --vibeui-switch-009-*.
Tags
- switch
- theme
- dark-mode
- animation
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…