kuratlielia

Split Theme Switch

Buttons 1

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

    340
  • Image Compare

    Image Compare

    104
  • User Menu

    User Menu

    93
  • Date Range Picker

    Date Range Picker

    62
  • Stats Band

    Stats Band

    52
  • Usage Meter

    Usage Meter

    45
  • Signature Pad

    Signature Pad

    37
  • Timeline

    Timeline

    33

More in Buttons

View all
  • Button

    Button

    5
  • Texture Button

    Texture Button

    92
  • App Store Button

    App Store Button

    453
  • Button

    Button

    47
  • Eclipse Button

    Eclipse Button

    39
  • Split Button

    Split Button

    14
  • Button

    Button

    4
  • Button Group

    Button Group

    37