Vibary.ai
← Vibe Coding

Invoice Line Expand

A charge unfolds into the lines that make it up, with its own amount pinned in place.

commerceminimalpremiuminteraction · finite · starter · ~0.5s
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.

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

/**
 * Vibary · Invoice Line Expand
 *
 * A charge unfolds into the lines that make it up. The charge's own
 * amount never moves — it stays pinned to the right of its row while the

About this pattern

Reconciling a bill, treated as a motion problem. The charge's amount never moves: it stays pinned to the right of its row while the breakdown opens underneath, so the figure being explained is still where the eye left it. Charges open independently rather than one at a time, because comparing two charges means holding both open. Height is tweened and short — a genuine size change deserves a curve, and a spring here would bounce every billing figure below it — while the itemised lines fade in a hair apart as the panel finishes opening.

Invoice breakdownBilling statement detailSubscription charge itemisationExpense report line

Where it shows up

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

  • OverviewLast 30 days
    Revenue$48,210+12.4%
    Orders1,284+3.1%
    Refunds$1,940−0.8%
    Revenue by day
    Dashboard

    Invoice charges expand into their metered components without the totals shifting.

Related patterns