Commerce
Payment Notification
A payment lands on the lock screen, the app opens and the amount counts up.
"use client";
import { useRef } from "react";
import gsap from "gsap";
import { useGSAP } from "@gsap/react";
gsap.registerPlugin(useGSAP);
export type PaymentNotificationProps = {
/** Amount the counter climbs to. */
amount?: number;
/** ISO 4217 currency code. */
currency?: string;
/** Locale used to format the amount. */
locale?: string;
/** Who sent the payment. */
sender?: string;
/** What the payment was for. */
reference?: string;
/** Notification title. */
title?: string;
/** App name shown on the notification. */
appName?: string;
/** Clock on the lock screen. */
time?: string;
/** Date line under the clock. */
date?: string;
/** Color of the app icon and the check. */
accent?: string;
/** Replay forever with a pause between runs. */
loop?: boolean;
className?: string;
};
export default function PaymentNotification({
amount = 150,
currency = "USD",
locale = "en-US",
sender = "Alex M.",
reference = "Order #1042",
title = "Payment received",
appName = "Bank",
time = "14:02",
date = "Saturday, October 18",
accent = "#1f5bff",
loop = true,
className = "",
}: PaymentNotificationProps) {
const root = useRef<HTMLDivElement>(null);
const amountText = useRef<HTMLDivElement>(null);
const money = new Intl.NumberFormat(locale, { style: "currency", currency });
useGSAP(
() => {
const q = gsap.utils.selector(root);
const counter = { v: 0 };
const write = () => {
if (amountText.current) amountText.current.textContent = money.format(counter.v);
};
const tl = gsap.timeline({ repeat: loop ? -1 : 0, repeatDelay: 1.4 });
tl.set(q("[data-app]"), { autoAlpha: 0 })
.set(q("[data-notif]"), { y: -110, autoAlpha: 1, scale: 1 })
.set(q("[data-check-path]"), { strokeDashoffset: 24 })
.set(q("[data-check]"), { scale: 0 })
.set(q("[data-from]"), { autoAlpha: 0, y: 10 })
.set(counter, { v: 0 })
.add(write, 0)
.to(q("[data-notif]"), { y: 0, duration: 0.6, ease: "back.out(1.6)" }, 0.6)
.to(q("[data-notif]"), { scale: 0.97, duration: 0.12, yoyo: true, repeat: 1 }, 2.0)
.to(q("[data-app]"), { autoAlpha: 1, duration: 0.35 }, 2.3)
.to(q("[data-check]"), { scale: 1, duration: 0.45, ease: "back.out(2)" }, 2.5)
.to(q("[data-check-path]"), { strokeDashoffset: 0, duration: 0.4 }, 2.8)
.to(counter, { v: amount, duration: 1.3, ease: "power2.out", onUpdate: write }, 2.8)
.to(q("[data-from]"), { autoAlpha: 1, y: 0, duration: 0.4 }, 3.6)
.to({}, { duration: 1.2 });
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) tl.progress(1).pause();
},
{ scope: root, dependencies: [amount, currency, locale, loop] },
);
return (
<div
ref={root}
className={`relative h-[520px] w-[290px] shrink-0 overflow-hidden rounded-[34px] bg-neutral-950 p-[9px] shadow-2xl ${className}`}
>
<div className="relative h-full w-full overflow-hidden rounded-[26px] bg-linear-to-b from-slate-800 to-slate-950">
<div className="absolute inset-x-0 top-[70px] text-center text-white">
<div className="text-6xl font-light tracking-tight">{time}</div>
<div className="mt-1 text-[13px] opacity-80">{date}</div>
</div>
<div
data-notif
className="absolute inset-x-[10px] top-3 flex items-start gap-2.5 rounded-2xl bg-white/95 px-3 py-2.5 text-neutral-900 shadow-lg"
>
<div
className="grid h-[30px] w-[30px] shrink-0 place-items-center rounded-lg text-[15px] font-bold text-white"
style={{ backgroundColor: accent }}
>
$
</div>
<div className="min-w-0">
<div className="text-[10.5px] uppercase text-neutral-500">{appName} · now</div>
<div className="text-[13px] font-semibold">{title}</div>
<div className="text-[12.5px]">
{money.format(amount)} from {sender}
</div>
</div>
</div>
<div
data-app
className="absolute inset-0 flex flex-col items-center justify-center gap-1.5 bg-neutral-50 text-neutral-900"
>
<div
data-check
className="mb-2 grid h-[58px] w-[58px] place-items-center rounded-full"
style={{ backgroundColor: accent }}
>
<svg
viewBox="0 0 24 24"
className="h-7 w-7"
fill="none"
stroke="#ffffff"
strokeWidth={3}
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
>
<path data-check-path d="M5 12.5l4.5 4.5L19 7.5" strokeDasharray={24} strokeDashoffset={24} />
</svg>
</div>
<div className="text-[12px] uppercase tracking-[0.08em] text-neutral-500">{title}</div>
<div ref={amountText} className="text-[40px] font-bold tabular-nums tracking-tight">
{money.format(0)}
</div>
<div data-from className="text-[13px] text-neutral-600">
{reference} · {sender}
</div>
</div>
</div>
</div>
);
}
Paste this into Claude Code inside your project. It installs the skills your agent needs, asks for your texts and colors, and recreates this animation in your stack.
SkillsGSAP skillsHyperFrames · optional, for video
Claude Code
Recreate the "Payment Notification" animated component from Motionshelf (https://motionshelf-pi.vercel.app) in my current project, adapted to my brand. Answer me in the language I write to you in. Work in this order: 1. Tools: Check whether the official GSAP skills are installed (gsap-core, gsap-timeline, gsap-react). If they are not, ask me and then run `npx skills add https://github.com/greensock/gsap-skills` (choose Claude Code). If they do not show up in this session yet, read the SKILL.md files the installer created for gsap-timeline and gsap-react before writing code. 2. Project: Look at my project: framework (Next.js, Vite, plain HTML…), TypeScript or JavaScript, Tailwind or plain CSS. Build it as one component that fits this stack. In React use gsap and @gsap/react; in plain HTML use GSAP from npm or a CDN. 3. Ask me before coding: Ask me these in a single message, showing the example values as defaults: - the amount, currency and number format (e.g. BRL with pt-BR) - who sent it, what it was for, and the app name - the accent color of the app icon and the check - the language of the texts 4. The animation What it looks like: A phone lock screen with a large clock. A payment notification drops in from the top; then the bank app opens with a check mark and the amount counting up. Step by step: - At 0.6 s the notification drops from above (y -110 → 0, 0.6 s, back.out(1.6)). - At 2.0 s it gets a quick tap (scale 0.97 and back), and at 2.3 s the app screen fades in over the lock screen. - A round check badge pops in (back.out(2)) and its check mark draws itself (stroke-dashoffset to 0). - At 2.8 s the amount counts from 0 to the total in 1.3 s (power2.out), formatted with Intl.NumberFormat in the chosen currency; at 3.6 s the reference line fades in. Rules: - Use one GSAP timeline that loops forever with a short pause between runs (repeat: -1). If the step by step gives the pause, use that value; otherwise repeatDelay about 1.4 s. - Set every starting state with set() at the start of the timeline, never with from(): on the second loop from() starts from the wrong place. - Elements that appear later and would push the layout (new chat bubbles, new rows) stay display:none until their turn; elements that already have their place in the layout (a subtitle, a button) start hidden with autoAlpha 0, so nothing jumps. - If there is a cursor or pointer, it aims at the measured center of its target (getBoundingClientRect), never at fixed pixel coordinates; if the component is scaled, divide by the scale. - Blur only in the middle of a movement and always end at blur(0). - With prefers-reduced-motion, jump to the final frame and stop (tl.progress(1).pause()). - In React, use useGSAP from @gsap/react with a scope ref, so the timeline is cleaned up on unmount. - All example content stays generic (no real brands, logos or people). - Use a generic bank icon; do not copy the logo of a real bank or payment method. 5. Check: Run it and watch the first and the third loop (they must look the same). Check it at 390 px wide with no sideways scroll, with reduced motion turned on, and with a clean console. Tell me what you checked. 6. Video (optional): If I also want this as an MP4 (ads, stories, WhatsApp status), install the HyperFrames plugin with `claude plugin marketplace add heygen-com/hyperframes` and `claude plugin install hyperframes@hyperframes`, then use /hyperframes:hyperframes to render the same animation in 9:16, 1:1 or 16:9. Rendering needs FFmpeg installed, or render with --docker (downloads about 3.3 GB the first time). Ask me before installing. Shortcut: If I only want the ready-made component instead, it installs with `npx shadcn@latest add https://motionshelf-pi.vercel.app/r/payment-notification.json`.
Other agentsUsing Cursor, Codex, Gemini CLI or another agent? This version tells it to find its own way to load the same skills before it starts.
Other agents
Recreate the "Payment Notification" animated component from Motionshelf (https://motionshelf-pi.vercel.app) in my current project, adapted to my brand. Answer me in the language I write to you in. Work in this order: 1. Tools: These instructions were written for Claude Code, which uses "skills" (folders with a SKILL.md that teach it a technique). First find out how you load skills, rules or instructions, and get the same knowledge: (a) if your agent is supported by the skills installer, ask me and run `npx skills add https://github.com/greensock/gsap-skills --agent <your-agent>` (for example codex, opencode, antigravity); (b) otherwise copy the skill folders from https://github.com/greensock/gsap-skills into your skills or rules directory (in Cursor: Settings → Rules → Remote Rule (GitHub) → greensock/gsap-skills); (c) if you cannot load skills at all, open the SKILL.md files in https://github.com/greensock/gsap-skills and read them as instructions before coding. Tell me which path you used. 2. Project: Look at my project: framework (Next.js, Vite, plain HTML…), TypeScript or JavaScript, Tailwind or plain CSS. Build it as one component that fits this stack. In React use gsap and @gsap/react; in plain HTML use GSAP from npm or a CDN. 3. Ask me before coding: Ask me these in a single message, showing the example values as defaults: - the amount, currency and number format (e.g. BRL with pt-BR) - who sent it, what it was for, and the app name - the accent color of the app icon and the check - the language of the texts 4. The animation What it looks like: A phone lock screen with a large clock. A payment notification drops in from the top; then the bank app opens with a check mark and the amount counting up. Step by step: - At 0.6 s the notification drops from above (y -110 → 0, 0.6 s, back.out(1.6)). - At 2.0 s it gets a quick tap (scale 0.97 and back), and at 2.3 s the app screen fades in over the lock screen. - A round check badge pops in (back.out(2)) and its check mark draws itself (stroke-dashoffset to 0). - At 2.8 s the amount counts from 0 to the total in 1.3 s (power2.out), formatted with Intl.NumberFormat in the chosen currency; at 3.6 s the reference line fades in. Rules: - Use one GSAP timeline that loops forever with a short pause between runs (repeat: -1). If the step by step gives the pause, use that value; otherwise repeatDelay about 1.4 s. - Set every starting state with set() at the start of the timeline, never with from(): on the second loop from() starts from the wrong place. - Elements that appear later and would push the layout (new chat bubbles, new rows) stay display:none until their turn; elements that already have their place in the layout (a subtitle, a button) start hidden with autoAlpha 0, so nothing jumps. - If there is a cursor or pointer, it aims at the measured center of its target (getBoundingClientRect), never at fixed pixel coordinates; if the component is scaled, divide by the scale. - Blur only in the middle of a movement and always end at blur(0). - With prefers-reduced-motion, jump to the final frame and stop (tl.progress(1).pause()). - In React, use useGSAP from @gsap/react with a scope ref, so the timeline is cleaned up on unmount. - All example content stays generic (no real brands, logos or people). - Use a generic bank icon; do not copy the logo of a real bank or payment method. 5. Check: Run it and watch the first and the third loop (they must look the same). Check it at 390 px wide with no sideways scroll, with reduced motion turned on, and with a clean console. Tell me what you checked. 6. Video (optional): If I also want this as an MP4 (ads, stories, WhatsApp status), install the HyperFrames skills with `npx skills add heygen-com/hyperframes` (choose your agent) and render the same animation in 9:16, 1:1 or 16:9. Rendering needs FFmpeg installed, or render with --docker (downloads about 3.3 GB the first time). Ask me before installing. Shortcut: If I only want the ready-made component instead, it installs with `npx shadcn@latest add https://motionshelf-pi.vercel.app/r/payment-notification.json`.
Install
npx shadcn@latest add https://motionshelf-pi.vercel.app/r/payment-notification.jsonCopies the file into your project. Requires React 19, Tailwind CSS v4 and GSAP (installed as a dependency).
Props
| Name | Type | Default | Description |
|---|---|---|---|
| amount | number | 150 | Amount the counter climbs to. |
| currency | string | "USD" | ISO 4217 currency code. |
| locale | string | "en-US" | Locale used to format the amount. |
| sender | string | "Alex M." | Who sent the payment. |
| reference | string | "Order #1042" | What the payment was for. |
| title | string | "Payment received" | Notification title. |
| appName | string | "Bank" | App name shown on the notification. |
| time | string | "14:02" | Clock on the lock screen. |
| date | string | "Saturday, October 18" | Date line under the clock. |
| accent | string | "#1f5bff" | Color of the app icon and the check. |
| loop | boolean | true | Replay forever with a pause between runs. |
| className | string | "" | Extra classes for the outer element. |
Dependencies
- gsap
- @gsap/react