serayudigital

Theme Toggle

Buttons 3

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>
  );
}

Dependencies

More by serayudigital

View all
  • Date Picker

    Date Picker

    13
  • Time Picker

    Time Picker

    2
  • Auth Login Screen

    Auth Login Screen

  • Mobile Search

    Mobile Search

  • Data Table

    Data Table

  • Chat Bubble

    Chat Bubble

More in Buttons

View all
  • Button

    Button

    20
  • Button

    Button

    3
  • Button Group

    Button Group

    18
  • Button

    Button

    149
  • Icon Label Subtext Button

    Icon Label Subtext Button

    69
  • Button

    Button

    9
  • Button

    Button

    37
  • Texture Button

    Texture Button

    113