loading code fetching the highlighted snippet
A variants map gives you named animation states. Pass the label string to animate and motion looks it up and tweens there — the workhorse pattern for any binary toggle.
animate={ opacity, scale, … } directly — variants
are just a way to name those targets.animate={isOpen ? "open" : "closed"} swaps between labels. Motion tweens
between the two variant objects automatically — no need to spread the props manually or
duplicate the transition config.motion.* with matching variant keys animates together. See variants-propagation for that.