Gestures

Motion · Next.js

Notifications you swipe away

Throw a notification aside and it flies off; for four seconds you can undo it, then it's gone and the rest close the gap.

With Wardic: Solid 1 · Solid 2

Live demo

Swipe one aside, either way.

Loading your notifications…

Reduced motion: The card still follows your finger; a throw sends it off at once, and the rows below move up at once.

Beside Wardic

Motion has no next("settled"). Its card says the throw has landed through onAnimationComplete, by the variant's name, which offers "Undo" and starts a timer; the request goes when the timer ends, as a server action that refreshes the page, and the row leaves with the list read again. Undo, or a refusal, clears the timer and flies the card back. On Solid 2 the throw, its landing, the undo window and the request are one action. The throw takes over from dragSnapToOrigin's spring back in both.

The code

Highlighting…