Entrances

Motion · Next.js

The product grid

The shop's grid fades and rises in, one card after another.

With Wardic: Solid 1 · Solid 2

Live demo

Loading the shop…

Reduced motion: The cards fade in, still one after another, but don't rise: movement is dropped, opacity stays. Under the pointer they don't lift and their photos don't grow.

Beside Wardic

Motion's card can't name its hover in whileHover: a variant name there makes the card a variant controller of its own, which stops following the grid's initial and animate, so it would neither enter nor stagger. Its card lifts by a target, whileHover={{ y: -4 }}, which keeps it in the grid's tree, and its photo hears the hover through onHoverStart and onHoverEnd, as state. Wardic passes the grid's names down past a card's own whileHover, and the hover's name on to its photo. And Motion starts the entrance once React has hydrated the grid, where Wardic starts it as the grid streams in, from the CSS it writes into it.

The code

Highlighting…