kuratlielia

Split Theme Switch

Buttons 2

About

A toggle button that switches a page between light and dark theme with an animated sun/moon icon swap.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Split Theme Switch to your project and fits it to your theme.

Code

How Split Theme Switch is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import ThemeSwitch, { type Theme } from "@/components/ui/theme-switch-split";
import { useState } from "react";

export default function ThemeSwitchSplitDemo() {
  const [theme, setTheme] = useState<Theme>("light");

  return (
    <div
      className="flex w-full h-screen items-center justify-center"
      style={{ background: "var(--background)", color: "var(--foreground)" }}
      data-theme={theme}
    >
      <ThemeSwitch
        theme={theme}
        variant="split"
        onThemeChange={(next) => setTheme(next)}
      />
    </div>
  );
}

Dependencies

More by kuratlielia

View all
  • Activity Heatmap

    Activity Heatmap

    480
  • Image Compare

    Image Compare

    129
  • User Menu

    User Menu

    102
  • Date Range Picker

    Date Range Picker

    76
  • Stats Band

    Stats Band

    71
  • Usage Meter

    Usage Meter

    52
  • Signature Pad

    Signature Pad

    40
  • Timeline

    Timeline

    38

More in Buttons

View all
  • Button

    Button

    1
  • Texture Button

    Texture Button

    97
  • Eclipse Button

    Eclipse Button

    39
  • App Store Button

    App Store Button

    458
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Button

    Button

    4
  • Button

    Button

    65
  • Button

    Button

    68