GODRICH
#css-animation#button#loader#transition#scroll#dashboard#ui#design-trends

04Toggle-class state transition

A single boolean state maps straight onto one className, and CSS transitions handle everything in between — "state decides the class, CSS decides the motion" is the most common pattern in React.

Best forExpand/collapse panels, active nav items, open dialogs

useStateclassNametransition
Toggle-class state transition
Open in a new tab

04 Toggle-class state transition — Measured area 1.805% · moving frames 11/23Original by GODRICH · SCSS and React ship in the zip · 9 CSS Animations in React Without Framer Motion

The post this demo lives in

9 CSS Animations in React Without Framer Motion - preview of all 9 demos9 CSS Animations in React Without Framer MotionA card fading in, a modal closing, a list item sliding away — usually that's CSS timed to when React mounts, unmounts, o See all demos in this post

If you like this effect - similar demos