Kain Xu

Theme Switch Button

Buttons 364

About

The ⁠ThemeSwitchButton is an animated icon button designed to toggle the application’s theme between light and dark modes. When pressed, the icon smoothly transitions (e.g., sun to moon), providing visual feedback to the user. It is customisable, accessible, and ideal for prominent placement in user interfaces where theme switching is required.

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

Code

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

Usage.tsx

'use client'

import * as React from "react"
import { ThemeSwitch } from "@/components/ui/theme-switch-button"

export function ThemeSwitchDemo() {
  return (
    <div className="flex justify-center items-center py-8">
      <ThemeSwitch />
    </div>
  )
}

export { ThemeSwitchDemo }

Dependencies

More by Kain Xu

View all
  • SpiralAnimation

    SpiralAnimation

    2.4K
  • ParticleTextEffect

    ParticleTextEffect

    2.2K
  • FlowButton

    FlowButton

    1.5K
  • Wave Background

    Wave Background

    1.5K
  • layered text

    layered text

    1.1K
  • Entropy

    Entropy

    1.1K
  • LiquidRadio

    LiquidRadio

    876
  • BlurTextAnimation

    BlurTextAnimation

    500

More in Buttons

View all
  • Button

    Button

    166
  • Texture Button

    Texture Button

    121
  • Button

    Button

    21
  • Figma File Button

    Figma File Button

    39
  • Native Button

    Native Button

    12
  • Button

    Button

    88
  • HeroUI Button Group

    HeroUI Button Group

    11
  • Great UI Button

    Great UI Button

    19