About
A button that cycles through light, dark, and system theme preferences and shows a sun, moon, or monitor icon for the active mode.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Theme Toggle to your project and fits it to your theme.
Code
How Theme Toggle is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import { ThemeToggle } from "@/components/ui/theme-toggle";
export default function ThemeToggleDemo() {
return (
<div className="flex min-h-[240px] w-full items-center justify-center bg-background p-10 text-foreground">
<div className="flex flex-col items-center gap-4 rounded-lg border border-border bg-card p-8">
<p className="text-sm text-muted-foreground">
Click to cycle light / dark / system
</p>
<ThemeToggle ariaLabel="Toggle theme" />
</div>
</div>
);
}












