Presence

Motion · Next.js

Saved for later, moved to the cart

Move a saved piece to your cart and its photo flies into the cart; remove one and it fades. The rest close up behind it.

With Wardic: Solid 1 · Solid 2

Live demo
  • Ember Bottle Vase
    Ember Bottle Vase$96
  • Brushstroke Jug
    Brushstroke Jug$88
  • Faceted Carafe
    Faceted Carafe$120
  • Tulip Bowl
    Tulip Bowl$92

Reduced motion: Nothing flies: a row moved to the cart or removed fades, and the rows below move up at once.

Beside Wardic

Motion's flight is the same layoutId pair, and React 19's useOptimistic is Solid 2's createOptimisticStore: the row leaves inside a transition and comes back if the store refuses it. The header's twin needs the pieces in flight shared with the page: a small store outside React, read with useSyncExternalStore, where Wardic's apps share a signal. React keeps a leaving row rendered until its exit ends, so its photo is still there when the twin mounts, and Motion crossfades the two as the photo flies; Solid 2's optimistic list keeps the row too, and does the same. Solid 1 has disposed of it by then, so Wardic flies the twin from where the photo was, at full opacity.

The code

Highlighting…