Kain Xu

Theme Switch Button

Buttons 356

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

    868
  • BlurTextAnimation

    BlurTextAnimation

    496

More in Buttons

View all
  • Button

    Button

    12
  • Notification Button

    Notification Button

    115
  • Texture Button

    Texture Button

    105
  • HeroUI Button Group

    HeroUI Button Group

    2
  • App Store Button

    App Store Button

    482
  • Split Button

    Split Button

    16
  • Button

    Button

    78
  • Button

    Button

    5