unlumen

Theme Switch

Component

About

Animated dark / light mode toggle button with a spring-driven sun ↔ moon icon swap and View Transition page reveal. Built on next-themes and Motion.

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

Code

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

Usage.tsx

"use client"

import { ThemeProvider } from "next-themes"
import { ThemeSwitch } from "@/components/ui/unlumen-theme-switch"

export default function ThemeSwitchDemo() {
  return (
    <ThemeProvider attribute="class" defaultTheme="dark" enableSystem={false}>
      <div className="flex items-center justify-center gap-4 p-8">
        <ThemeSwitch iconSize={16} />
      </div>
    </ThemeProvider>
  );
}

Dependencies

More by unlumen

View all
  • Motion Navigation Menu

    Motion Navigation Menu

    316
  • Side By Side Slide

    Side By Side Slide

    300
  • Scroll Reveal Image

    Scroll Reveal Image

    251
  • Count Up

    Count Up

    183
  • Pixel Liquid Background

    Pixel Liquid Background

    137
  • Animated Sidebar

    Animated Sidebar

    122
  • Glow Button

    Glow Button

    116
  • Horizontal Depth Fade

    Horizontal Depth Fade

    95