Gestures

Motion · Next.js

A wishlist you rearrange by hand

Drag a piece up or down and the others make way; let go and the new order is saved. The list is shared, and other people's moves glide in live.

With Wardic: Solid 1 · Solid 2

Live demo

Shared by everyone who opens this page. You're Moth: open it in a private window too, and rearrange it in both.

Loading the wishlist…

Reduced motion: The piece you hold still follows your hand; the others move to their new places at once, and so does the drop.

Beside Wardic

Motion's Reorder.Group tells each step of a drag (onReorder), not its start or end, so its list holds the piece in your hand from each item's onDragStart to its onDragEnd, and saves from onDragEnd when the order changed. Wardic's group tells holdStart, onReorderEnd (once a gesture, only when the order changed) and holdEnd, for a keyboard lift too: Motion's Reorder has no keys. And Next.js has no live server function: Motion's list is shared through a route handler that streams the store's changes as server-sent events, which the page reads with an EventSource, where Solid 2 has live(). Solid 1's list is the visitor's own.

The code

Highlighting…