Skip to content
Click to toggle
Interaction
Click toggle
Duration
0.50 s
Artboard
32 × 32 px
Lottie size
1.3 kB

Toggle

Toggles between two states on click, or switches immediately when reduced motion is preferred. Free under the MIT license.

formon offswitchtoggletoggle-lefttoggle-right

React

npm install react-useanimations
import UseAnimations from 'react-useanimations';
import toggle from 'react-useanimations/lib/toggle';

<UseAnimations animation={toggle} size={32} />

shadcn/ui

npx shadcn@latest add https://useanimations.com/r/toggle.json
import { AnimatedToggle } from '@/components/animations/toggle';

<AnimatedToggle size={24} />

Files

https://useanimations.com/icons/toggle.json  # Lottie JSON
https://useanimations.com/icons/toggle.zip   # Lottie JSON + static SVGs

The animation as Lottie JSON and a ZIP with it and the SVGs. See Files & icons.json.

Static SVG

toggle-left.svg
toggle-right.svg