Live Demo

React Theme
Switch Animation

Beautiful, smooth animations for theme switching in React applications.Built with TypeScript and powered by the View Transition API.

Try Different Animations

Click any toggle below to experience the theme switch animations

Circle

Smooth expanding circle transition

Duration750ms
Easingease-in-out
🌀

Blur Circle

Circle with elegant blur effect

Duration750ms
Easingease-in-out
📱

QR Scan

Scanning line sweeps left to right

Duration750ms
Easingease-in-out

Why Choose This Library?

High Performance

Optimized for high-resolution displays with smooth 60fps animations

🎨

Multiple Animations

Circle, blur circle, and QR scan effects with more coming soon

📱

Responsive Design

Works perfectly across all device sizes and screen resolutions

Accessibility First

Respects prefers-reduced-motion and provides fallback experiences

Simple to Use

Get started with just a few lines of code

example.tsx
import { useModeAnimation, ThemeAnimationType } from 'react-theme-switch-animation'

function ThemeToggle() {
  const { ref, toggleSwitchTheme, isDarkMode } = useModeAnimation({
    animationType: ThemeAnimationType.CIRCLE
  })

  return (
    <button ref={ref} onClick={toggleSwitchTheme}>
      {isDarkMode ? '🌙' : '☀️'}
    </button>
  )
}