# Theme Toggle View Transitions

> Light and dark mode switch animations using the View Transitions API, with the CSS for each one.

Canonical page: https://sitepeel.dev/resources/theme-toggle-view-transitions/

Website: https://theme-toggle.rdsx.dev/

Category: Micro interactions. Access: Free.

## What it is

Short guide with seven demos: circle reveals, blurred circles, polygons, a gradient wipe and two GIF wipes. It shows the two lines of JavaScript you need, then the CSS behind each effect so you can copy and change it.

## Is it for you?

- Made for: Front-end developers who want a nicer animation when people switch between light and dark mode.
- You need: A browser with View Transitions support. Others just switch without the animation
- Price: Free

## What you can do with it

- Add a circle reveal to a dark mode button
- Learn how view transition masks and clip paths work
- Copy ready CSS for a theme switch effect

Good to know: The GitHub repo has no licence file, so check with the author before reusing code commercially.

## More like this

- [Cursify](https://sitepeel.dev/resources/cursify/index.md): Animated cursor effects for React and Next.js, like fairy dust, bubbles, snowflakes and spotlight, with code to copy.
- [CSS Hover Effects](https://sitepeel.dev/resources/css-hover-effects/index.md): Dozens of ready hover animations for buttons and links, like grow, wobble, sweep and underline, in CSS, Sass or LESS.
- [Design Spells](https://sitepeel.dev/resources/design-spells/index.md): Small design details from real products: micro-interactions, easter eggs and playful touches.

All resources: https://sitepeel.dev/resources/index.md. Checked on 2026-12-05.
