Components66 / 118
Meet Button
A call to action where you meet the person you're booking. Hover the raised black pill: the label slides away with a blur, and a person rises in beside a white "You" circle that spins upright as it arrives. A beat later "You" slides over to meet them and "Let's talk!" resolves word by word out of a blur. Until they meet, "You" leans after your cursor; the pill drifts toward it, and a press bumps the two together.
CTACTAAvatarsAvatarsMotion blurMotion blurMagneticMagneticLink or buttonLink or buttonGSAPGSAP
Hover, then move aroundPress it
Tweak
LIVELIVEText
Look
56px
#0b0b0c
#ececec
Usage
Follows your tweaks.
usage.tsx
import { MeetButton } from "@/components/inreact/meet-button";
export function Cta() {
return <MeetButton avatar="/team/you.jpg" href="/book" size={56} />;
}Install with the CLI
TS + Tailwind
npx shadcn@latest add https://inreact.vercel.app/r/meet-button.jsonOr copy the source
Install the dependencies, then save this as components/inreact/meet-button.tsx.
terminal
npm install gsapcomponents/inreact/meet-button.tsx
"use client";
import { gsap } from "gsap";
import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from "react";
/**
* Meet Button: a call to action where you meet the person you're booking.
*
* A raised black pill. Hover it: it gives a little squash, the label dips and
* shoots away, and a person bounces up into view beside a white "You" circle
* that spins upright as it lands. A beat later "You" winds back, darts over and
* bumps into them, and the invitation ("Let's talk!") springs in word by word.
*
* Every piece is a spring body: it overshoots and settles, and it squashes and
* stretches along its own motion (volume-preserving), wobbling after it stops.
* GSAP choreographs where things want to be; the springs decide how they get
* there. Until you meet, "You" leans after your cursor, the pill drifts toward
* it, and a press squashes the pill and knocks the two circles together.
*
* <MeetButton label="Book a call" hoverLabel="Let's talk!" avatar="/me.jpg" href="/book" />
*/
export interface MeetButtonProps {
/** Resting label. */
label?: string;
/** What it says once you've met. */
hoverLabel?: string;
/** The person's photo. */
avatar: string;
/** Where their face sits (object-position). */
avatarFocus?: string;
/** The visitor's circle. */
you?: string;
href?: string;
onClick?: () => void;
/** Height, px. */
size?: number;
/** The pill. */
color?: string;
/** Text on the pill. */
ink?: string;
className?: string;
}
const reduced = () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
/* ---------- a tiny spring body with squash and stretch ---------- */
type Body = {
el: HTMLElement;
// where it wants to be (choreographed) + live offsets (cursor)
t: { x: number; y: number; r: number; u: number };
ox: number;
oy: number;
x: number; y: number; r: number; u: number;
vx: number; vy: number; vr: number; vu: number;
// stretch along the motion axis (s < 0 squashes), with its own wobbly spring
s: number; vs: number; a: number;
k: number; z: number; // position spring
ks: number; zs: number; // stretch spring
kv: number; max: number; // speed -> stretch
last: string;
};
function body(el: HTMLElement, o: Partial<Omit<Body, "t">> & { t?: Partial<Body["t"]> } = {}): Body {
const t = { x: 0, y: 0, r: 0, u: 1, ...o.t };
return {
el, ox: 0, oy: 0,
x: t.x, y: t.y, r: t.r, u: t.u, vx: 0, vy: 0, vr: 0, vu: 0,
s: 0, vs: 0, a: 90,
k: 220, z: 0.45, ks: 320, zs: 0.24, kv: 0.00026, max: 0.26,
last: "",
...o,
t,
};
}
function step(b: Body, dt: number, still: boolean) {
const tx = b.t.x + b.ox, ty = b.t.y + b.oy;
if (still) {
b.x = tx; b.y = ty; b.r = b.t.r; b.u = b.t.u; b.s = 0;
b.vx = b.vy = b.vr = b.vu = b.vs = 0;
return;
}
const c = 2 * b.z * Math.sqrt(b.k);
b.vx += (b.k * (tx - b.x) - c * b.vx) * dt; b.x += b.vx * dt;
b.vy += (b.k * (ty - b.y) - c * b.vy) * dt; b.y += b.vy * dt;
b.vr += (b.k * (b.t.r - b.r) - c * b.vr) * dt; b.r += b.vr * dt;
b.vu += (b.k * (b.t.u - b.u) - c * b.vu) * dt; b.u += b.vu * dt;
// stretch along where it's going; the axis turns smoothly (mod 180°, it's symmetric)
const speed = Math.hypot(b.vx, b.vy);
if (speed > 30) {
const want = (Math.atan2(b.vy, b.vx) * 180) / Math.PI;
const d = ((((want - b.a + 90) % 180) + 180) % 180) - 90;
b.a += d * Math.min(1, dt * 22);
}
const target = Math.min(b.max, speed * b.kv);
const cs = 2 * b.zs * Math.sqrt(b.ks);
b.vs += (b.ks * (target - b.s) - cs * b.vs) * dt;
b.s = Math.max(-0.32, Math.min(0.4, b.s + b.vs * dt));
}
function paint(b: Body) {
const f = (n: number) => Math.round(n * 100) / 100;
const s = 1 + b.s;
const tr = `translate3d(${f(b.x)}px,${f(b.y)}px,0) rotate(${f(b.a)}deg) scale(${f(s * 1000) / 1000},${f(1000 / s) / 1000}) rotate(${f(b.r - b.a)}deg) scale(${f(b.u * 1000) / 1000})`;
if (tr !== b.last) {
b.el.style.transform = tr;
b.last = tr;
}
}
export function MeetButton({
label = "Book a call",
hoverLabel = "Let's talk!",
avatar,
avatarFocus = "50% 25%",
you = "You",
href,
onClick,
size = 52,
color = "#0b0b0c",
ink = "#ffffff",
className,
}: MeetButtonProps) {
const rootRef = useRef<HTMLElement | null>(null);
const q = useRef<Record<string, HTMLElement | null>>({});
const set = (k: string) => (el: HTMLElement | null) => {
q.current[k] = el;
};
const words = hoverLabel.split(" ");
const [width, setWidth] = useState(0);
const H = size;
const c = Math.round(H * 0.8); // circle diameter
const padX = Math.round(H * 0.1);
const fs = Math.round(H * 0.27);
const plusBox = Math.round(H * 0.5);
// the pill is as wide as whichever state needs more room
useLayoutEffect(() => {
const lab = q.current.measureLabel, hov = q.current.measureHover;
if (!lab || !hov) return;
const closed = lab.offsetWidth + H * 0.9;
const open = c * 1.5 + H * 0.2 + hov.offsetWidth + H * 0.5;
const together = padX * 2 + c * 2 + H * 0.9; // person + "+" + you, side by side
setWidth(Math.ceil(Math.max(closed, open, together)));
}, [label, hoverLabel, size, H, c, padX]);
useEffect(() => {
const root = rootRef.current, $ = q.current;
if (!root || !width || !$.label || !$.person || !$.you || !$.plus || !$.words || !$.pill) return;
const still = reduced();
const wordEls = Array.from($.words.children) as HTMLElement[];
// where the circles sit: apart either side of the "+", then together at the left
const mid = width / 2;
const apart = { person: Math.min(mid - c - H * 0.3, width * 0.27 - c / 2), you: Math.max(mid + H * 0.3, width * 0.73 - c / 2) };
// the person tucks just past the left edge; "You" overlaps them by about half
const together = { person: -c * 0.1, you: c * 0.5 };
const below = H; // fully under the pill's lip
// bodies: each one bounces and squashes in its own character
const pill = body($.pill, { k: 170, z: 0.5, ks: 240, zs: 0.2, kv: 0.0004, max: 0.06 });
const lab = body($.label, { k: 300, z: 0.6, ks: 320, zs: 0.3, kv: 0.00022, max: 0.3 });
const per = body($.person, { t: { x: apart.person, y: below }, k: 210, z: 0.5 });
const yo = body($.you, { t: { x: apart.you, y: below, r: -55 }, k: 190, z: 0.38 });
const plus = body($.plus, { t: { u: 0, r: -120 }, k: 360, z: 0.36, kv: 0 });
const wb = wordEls.map((el) => body(el, { t: { x: H * 0.55, y: H * 0.18 }, k: 230, z: 0.42, ks: 300, zs: 0.22, kv: 0.0003, max: 0.3 }));
const all = [pill, lab, per, yo, plus, ...wb];
gsap.set([$.person, $.you], { opacity: 0, filter: "blur(8px)" });
gsap.set(wordEls, { opacity: 0, filter: "blur(6px)" });
gsap.set($.label, { opacity: 1, filter: "blur(0px)" });
all.forEach(paint);
const ME = 0.85; // the meeting
const tl = gsap.timeline({ paused: true, defaults: { ease: "power2.out" } });
// anticipation: the label dips, then shoots up and away
tl.to(lab.t, { y: H * 0.14, duration: 0.08 }, 0)
.to(lab.t, { y: -H * 1.15, duration: 0.1, ease: "power2.in" }, 0.08)
.to($.label, { opacity: 0, filter: "blur(5px)", duration: 0.2, ease: "power2.in" }, 0.1)
// the two bounce up into view; "You" spins upright as it lands
.to(per.t, { y: 0, duration: 0.1 }, 0.12)
.to($.person, { opacity: 1, filter: "blur(0px)", duration: 0.32 }, 0.12)
.to(yo.t, { y: 0, r: 0, duration: 0.1 }, 0.2)
.to($.you, { opacity: 1, filter: "blur(0px)", duration: 0.32 }, 0.2)
.to(plus.t, { u: 1, r: 0, duration: 0.08 }, 0.34)
// the meeting: "+" pops away, "You" winds back, darts in and bumps them
.to(plus.t, { u: 0, r: 120, duration: 0.08, ease: "power2.in" }, ME)
.to(yo.t, { x: apart.you + c * 0.2, r: 8, duration: 0.12 }, ME)
.to(yo.t, { x: together.you, r: -6, duration: 0.14, ease: "power3.in" }, ME + 0.12)
.to(yo.t, { r: 0, duration: 0.1 }, ME + 0.26)
.to(per.t, { x: together.person, duration: 0.2, ease: "power2.inOut" }, ME + 0.08)
.call(() => {
if (tl.reversed() || still) return;
// impact: both squash sideways, the person gets knocked a little further
per.vx -= H * 2.6; per.a = 0; per.vs -= 2.6;
yo.a = 0; yo.vs -= 4.2; yo.vx *= 0.2;
}, undefined, ME + 0.26)
// the invitation springs in word by word
.to(wb.map((b) => b.t), { x: 0, y: 0, duration: 0.1, stagger: 0.07 }, ME + 0.26)
.to(wordEls, { opacity: 1, filter: "blur(0px)", duration: 0.3, stagger: 0.07 }, ME + 0.26);
// until you meet, "You" leans after the cursor; the pill drifts toward it
const lean = { x: 0, y: 0 };
const tick = (_t: number, ms: number) => {
const free = 1 - gsap.utils.clamp(0, 1, (tl.time() - ME) / 0.25);
yo.ox = lean.x * free;
yo.oy = lean.y * free;
const dt = Math.min(ms / 1000, 1 / 30) / 2;
for (const b of all) {
step(b, dt, still);
step(b, dt, still);
paint(b);
}
};
gsap.ticker.add(tick);
let box = root.getBoundingClientRect();
const onEnter = () => {
box = root.getBoundingClientRect();
if (still) return void tl.progress(1);
// a little squash as it wakes up
pill.a = 90;
pill.vs -= 1.6;
tl.timeScale(1).play();
};
const onLeave = () => {
lean.x = lean.y = 0;
pill.ox = pill.oy = 0;
pill.t.u = 1;
if (still) return void tl.progress(0);
tl.timeScale(1.6).reverse();
};
const onMove = (e: PointerEvent) => {
if (still) return;
const r = box;
const nx = gsap.utils.clamp(-1.2, 1.2, (e.clientX - (r.left + r.width / 2)) / (r.width / 2));
const ny = gsap.utils.clamp(-1.2, 1.2, (e.clientY - (r.top + r.height / 2)) / (r.height / 2));
pill.ox = nx * H * 0.14;
pill.oy = ny * H * 0.12;
lean.x = gsap.utils.clamp(-1, 1, nx) * H * 0.16;
lean.y = gsap.utils.clamp(-1, 1, ny) * H * 0.08;
};
// a press squashes the pill and knocks the two together
const onDown = () => {
if (still) return;
pill.t.u = 0.95;
pill.a = 90;
pill.vs -= 2.4;
per.vx += H * 4;
yo.vx -= H * 4;
per.a = yo.a = 0;
per.vs -= 2.5;
yo.vs -= 2.5;
};
const onUp = () => {
if (still) return;
pill.t.u = 1;
pill.a = 90;
pill.vs += 2.6;
};
root.addEventListener("pointerenter", onEnter);
root.addEventListener("pointerleave", onLeave);
root.addEventListener("pointermove", onMove);
root.addEventListener("pointerdown", onDown);
root.addEventListener("pointerup", onUp);
root.addEventListener("focus", onEnter);
root.addEventListener("blur", onLeave);
return () => {
gsap.ticker.remove(tick);
tl.kill();
root.removeEventListener("pointerenter", onEnter);
root.removeEventListener("pointerleave", onLeave);
root.removeEventListener("pointermove", onMove);
root.removeEventListener("pointerdown", onDown);
root.removeEventListener("pointerup", onUp);
root.removeEventListener("focus", onEnter);
root.removeEventListener("blur", onLeave);
};
}, [width, c, H, padX, hoverLabel]);
const pillStyle = {
background: `radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, ${color}, white 9%) 0%, ${color} 60%)`,
borderRadius: H,
// raised: a soft lit edge on top, depth below, and a soft layered shadow
boxShadow:
"inset 0 1px 1px rgba(255,255,255,.16), inset 0 -2px 5px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.14), 0 4px 10px rgba(0,0,0,.14), 0 12px 26px rgba(0,0,0,.14)",
} as const;
const inner: ReactNode = (
<>
{/* hidden measurers */}
<span ref={set("measureLabel")} aria-hidden="true" className="pointer-events-none invisible absolute whitespace-nowrap font-semibold uppercase" style={{ fontSize: fs, letterSpacing: "0.01em" }}>
{label}
</span>
<span ref={set("measureHover")} aria-hidden="true" className="pointer-events-none invisible absolute whitespace-nowrap font-semibold" style={{ fontSize: fs * 1.12 }}>
{hoverLabel}
</span>
{/* the pill itself squashes and drifts; the hit area stays put */}
<span ref={set("pill")} className="absolute inset-0 will-change-transform" style={pillStyle}>
<span className="absolute inset-0 overflow-hidden" style={{ borderRadius: H }}>
{/* resting label */}
<span ref={set("label")} className="absolute inset-0 grid place-items-center whitespace-nowrap font-semibold uppercase will-change-[transform,filter]" style={{ fontSize: fs, letterSpacing: "0.01em" }}>
{label}
</span>
{/* the person */}
<span ref={set("person")} aria-hidden="true" className="absolute top-1/2 left-0 will-change-[transform,filter]" style={{ width: c, height: c, marginTop: -c / 2 }}>
<span className="block h-full w-full overflow-hidden rounded-full bg-[#d9d9d9]">
<img src={avatar} alt="" draggable={false} className="h-full w-full object-cover grayscale brightness-110 contrast-[.92]" style={{ objectPosition: avatarFocus }} />
</span>
</span>
{/* plus */}
<span ref={set("plus")} aria-hidden="true" className="absolute top-1/2 left-1/2 grid place-items-center font-semibold will-change-transform" style={{ width: plusBox, height: plusBox, margin: `${-plusBox / 2}px 0 0 ${-plusBox / 2}px`, fontSize: fs * 1.1 }}>
+
</span>
{/* you */}
<span ref={set("you")} aria-hidden="true" className="absolute top-1/2 left-0 will-change-[transform,filter]" style={{ width: c, height: c, marginTop: -c / 2 }}>
<span className="grid h-full w-full place-items-center rounded-full bg-white font-black uppercase text-black" style={{ fontSize: Math.round(c * 0.27), boxShadow: "0 0 0 2px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.3)" }}>
{you}
</span>
</span>
{/* the invitation, word by word */}
<span ref={set("words")} aria-hidden="true" className="absolute top-1/2 flex -translate-y-1/2 gap-[0.28em] whitespace-nowrap font-semibold" style={{ left: c * 1.5 + H * 0.2, fontSize: fs * 1.12 }}>
{words.map((w, i) => (
<span key={i} className="inline-block will-change-[transform,filter,opacity]">
{w}
</span>
))}
</span>
</span>
</span>
</>
);
const cls = ["relative inline-block shrink-0 select-none outline-none [-webkit-tap-highlight-color:transparent] focus-visible:[&>span]:ring-2 focus-visible:[&>span]:ring-black/40 focus-visible:[&>span]:ring-offset-2", className].filter(Boolean).join(" ");
const style = { height: H, width: width || undefined, color: ink, borderRadius: H } as const;
return href ? (
<a ref={(el) => void (rootRef.current = el)} href={href} onClick={onClick} className={cls} style={style} aria-label={`${label}. ${hoverLabel}`}>
{inner}
</a>
) : (
<button ref={(el) => void (rootRef.current = el)} type="button" onClick={onClick} className={cls} style={style} aria-label={`${label}. ${hoverLabel}`}>
{inner}
</button>
);
}
export default MeetButton;
One prompt, any AI agent
Paste into Claude Code, Codex, Cursor or Windsurf. It carries your tweaks and the full source, so the agent installs it exactly.
Props
11 propsavatarstringThe person's photo.avatarFocusstringWhere their face sits (object-position).default "50% 25%"default "50% 25%"labelstringResting label.default "Book a call"default "Book a call"hoverLabelstringWhat it says once you've met.default "Let's talk!"default "Let's talk!"youstringThe visitor's circle.default "You"default "You"hrefstringRender a link.onClick() => voidClick handler.sizenumberHeight, px.default 52default 52colorstringThe pill.default "#0b0b0c"default "#0b0b0c"inkstringText on the pill.default "#ffffff"default "#ffffff"classNamestringExtra classes.