spaceman/ react theme animation

Animated theme switching for React.

Dark mode and color themes that reveal with the View Transitions API. No flash on load, one hook for state, and setups for Next.js, Vite and TanStack Start.

View on npm

Seven transitions

01

Pick an effect, then switch the theme from the button.

Color themes

02

Palettes animate with the same transition as dark mode.

Any origin

03

Start the reveal from a button, a point or a screen edge.

One hook

04
useTheme() → {theme: –,resolvedTheme: –,colorTheme: –,}

Read and set everything from the same hook in any framework.

Install

npm i @space-man/react-theme-animation
app/providers.tsx
'use client'import { ThemeProvider } from '@space-man/react-theme-animation'export function Providers({ children }) {  return (    <ThemeProvider defaultTheme='system' animationType='circle'>      {children}    </ThemeProvider>  )}

Framework guides

Each guide is a small app you can run locally. The source is in spaceman-rta-framework-guides.