Vibary.ai
← Vibe Coding

Cart Drawer Open

The cart panel travels in from the edge and its line items arrive a beat behind it.

commercepremiumminimalinteraction · finite · intermediate · ~0.7s
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.

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

/**
 * Vibary · Cart Drawer Open
 *
 * The cart travels in from the edge and its contents arrive a beat
 * behind it — panel first, then line items a hair apart, then the

About this pattern

The panel that opens the moment something is added. The delay between the panel landing and its contents arriving is the whole trick: contents that ride in with the panel look painted onto it, contents that follow it look like they were always inside. Each line is delayed from one shared start rather than chained to the line before it, so a dropped frame cannot stretch the gaps into a queue, and the summary follows last. The panel is opaque over its scrim and springs at a damping ratio that lets it arrive once and stop.

Mini cart panelAdded-to-bag confirmationSide cart on a storefrontCheckout entry point

Where it shows up

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

  • Your bag
    Ridgeline GT — Bone, US 9−1+$132.00
    Merino crew sock, 2-pack−2+$24.00
    Subtotal$156.00Shipping$0.00Tax$13.65Total$169.65
    Checkout
    Cart

    Adding an item opens a side cart whose lines settle in just after the panel lands.

Related patterns