This component no longer exists. It was in PaceUI GSAP’s manifest when we first indexed it and is not there now — the registry served its inventory on 2026-08-06 and this item was not on it. The install command below will fail. It is kept here because a tutorial somewhere still tells people to run it.
Modal Ability Selector
paceui-gsap/ai-token-counterRemovedComponent
Compact selector for toggling abilities with icons and custom styles
Live preview
live · rendered by the registry
Rendered by PaceUI GSAP on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://gsap.paceui.com/r/ai-token-counter.jsonSource
1"use client";23import { useRef, useState } from "react";45import { useGSAP } from "@gsap/react";6import gsap from "gsap";7import { MotionPathPlugin } from "gsap/MotionPathPlugin";89import { cn } from "@/lib/utils";1011gsap.registerPlugin(MotionPathPlugin);1213export const AiTokenCounter = ({ sourceRef, token, className, flyingClassName, ...props }: any) => {14 const [displayCount, setDisplayCount] = useState(token);15 const lastToken = useRef(token);16 const counterRef = useRef<HTMLParagraphElement>(null);17 const flyingRef = useRef<HTMLParagraphElement>(null);1819 useGSAP(20 () => {21 const diff = token - lastToken.current;22 if (diff === 0 || !sourceRef.current || !counterRef.current || !flyingRef.current) return;2324 const startValue = lastToken.current;25 lastToken.current = token;2627 const [src, dest, fly] = [28 sourceRef.current.getBoundingClientRect(),29 counterRef.current.getBoundingClientRect(),30 flyingRef.current.getBoundingClientRect(),31 ];3233 const flyEl = flyingRef.current;34 flyEl.innerText = `${diff > 0 ? "+" : ""}${diff}`;3536 // Relative Math37 const start = {38 x: src.left + src.width / 2 - fly.left - fly.width / 2 - 15,39 y: src.top + src.height / 2 - fly.top - fly.height / 2,40 };41 const end = {42 x: dest.left + dest.width / 2 - fly.left - fly.width / 2,43 y: dest.top + dest.height / 2 - fly.top - fly.height / 2,44 };4546 const tl = gsap.timeline();47 tl.set(flyEl, { ...start, scale: 0.5, opacity: 0, visibility: "visible" })48 .to(flyEl, {49 duration: 0.6,50 ease: "power2.out",51 motionPath: { path: [start, { x: (start.x + end.x) / 2, y: Math.min(start.y, end.y) - 20 }, end] },52 opacity: 1,53 scale: 1,54 })55 .to(flyEl, { opacity: 0, scale: 0.5, duration: 0.2 }, "-=0.1")56 .to(57 { val: startValue },58 {59 val: token,60 duration: 0.4,61 onUpdate: function () {62 setDisplayCount(Math.floor(this.targets()[0].val));63 },64 onComplete: () => setDisplayCount(token),65// … truncated
What it pulls in
npm packages
