Vibary.ai
← Vibe Coding

Add to Cart Fly

The product tile arcs from the card into the cart glyph, and the badge ticks over on arrival.

commerceenergeticfriendlyinteraction · finite · intermediate · ~0.8s
Interactive · click to play
Variant

The animated component in this preview is rendered from the canonical file shown here. The surrounding demo shell only provides context and is not part of the copied code.

425 lines · react + motion only
import { useRef, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";

/**
 * Vibary · Add to Cart Fly
 *
 * The product tile leaves the card on an arc, shrinks into the cart
 * glyph, and only then does the badge tick over — the count changes

About this pattern

The buy moment, made legible. Pressing the buy control sends a copy of the product tile along an arc toward the cart glyph, shrinking as it goes, and the badge only changes once the tile has landed. Tying the count to an arrival rather than to the press answers the question shoppers actually ask — where did the thing I just bought go — which matters most in grids where several items are added in a row. The tile travels and shrinks; the number itself rolls and crossfades without ever changing size.

Buy control on a product pageQuick add from a product gridMoving a saved item into the bagReorder from purchase history

Where it shows up

Screens we drew to show where this motion usually sits. Illustrations, not captures of any product.

  • NewMenWomenSale
    Men's trail shoeRidgeline GT$132Bone
    88.599.510
    Add to bag
    Free delivery and returns
    Product details
    Product page

    Adding from a product page bumps the cart badge as the item registers.

Related patterns