Kain Xu

Theme Switch Button

Buttons 357

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
  • Wave Background

    Wave Background

    1.4K
  • FlowButton

    FlowButton

    1.4K
  • layered text

    layered text

    1.1K
  • Entropy

    Entropy

    1.1K
  • LiquidRadio

    LiquidRadio

    871
  • BlurTextAnimation

    BlurTextAnimation

    497

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    44
  • Button Save

    Button Save

    50
  • App Store Button

    App Store Button

    484
  • Base Button

    Base Button

    1