Product Catalog Card
Bordered white card with a purple product name, a muted two-line description and a tinted preview well below containing a clipped, cropped mini-UI illustration with skeleton bars and edge-fade masks. Cards are arranged two per row on the right of a sticky category title.
Rebuilt from stripe.com/products in the Iridescent Ledger style.
Looks exactly like stripe.com: brings its fonts and colours, namespaced so your own theme stays untouched.
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: title, intro, and items (array of {name, desc, kind: chat|form|list|chart}). Renders a two-column grid of bordered cards whose preview wells shift on hover; works with no props.
components/product-feature-card.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useState } from "react"; type Item = { name: string; desc: string; kind: "chat" | "form" | "list" | "chart" }; const DEFAULTS: Item[] = [ { name: "Concierge", desc: "Let shoppers find and order through assistants while keeping every order protected.", kind: "chat" }, { name: "Basket", desc: "A fast, brandable purchase page that lifts completed orders for most teams within weeks.", kind: "form" }, { name: "Vault", desc: "Saved profiles fill in details so returning buyers finish in seconds.", kind: "list" }, { name: "Insights", desc: "Track revenue trends, refunds and regional performance in a single clear view.", kind: "chart" }, ]; function Bar({ w = "w-24" }: { w?: string }) { return <div className={`h-1.5 rounded-pill bg-accent-wash ${w}`} />; } function Mini({ kind }: { kind: Item["kind"] }) { if (kind === "chat") return ( <div className="flex flex-col gap-3 px-6 pt-6"> <div className="self-end rounded-sm border border-hairline bg-surface px-4 py-2 text-ui text-ink">I need a green notebook</div> <div className="text-ui text-ink">Here is what I found:</div> <div className="flex items-center justify-between rounded-sm border border-hairline bg-surface p-4"> <div className="flex items-center gap-3"><div className="h-9 w-9 rounded-xs bg-accent-wash" /><div className="space-y-2"><Bar w="w-28" /><Bar w="w-20" /></div></div> <div className="rounded-pill border border-hairline px-3 py-1 text-caption text-ink">− 1 +</div> </div> </div> ); if (kind === "form") return ( <div className="mx-auto w-[72%] space-y-3 border-x border-hairline bg-surface px-6 pt-6"> <div className="text-caption text-ink">Email address</div> <div className="h-9 rounded-xs border border-hairline" /> <div className="text-caption text-ink">Payment</div> <div className="flex h-10 items-center justify-between rounded-xs border border-hairline px-3"><Bar /><div className="flex gap-1"><i className="h-2.5 w-4 rounded-[2px] bg-accent" /><i className="h-2.5 w-4 rounded-[2px] bg-signal-orange" /><i className="h-2.5 w-4 rounded-[2px] bg-signal-magenta" /></div></div> </div> ); if (kind === "list") return ( <div className="mx-auto w-[72%] space-y-2 bg-surface p-3 pb-0"> <div className="flex items-center justify-between"><div className="text-ui text-ink-deep font-medium">Wallet</div><div className="text-ink-faint">×</div></div> <div className="flex items-center gap-3 rounded-sm bg-surface-tint p-3"><i className="h-3 w-3 rounded-full bg-accent" /><span className="text-ui text-ink">•••• 1881</span></div> <div className="flex items-center gap-3 p-3"><i className="h-3 w-3 rounded-full border border-hairline" /><Bar w="w-28" /></div> </div> ); return ( <div className="mx-auto w-[80%] rounded-sm border border-hairline bg-surface p-5 pb-0"> <div className="text-ui font-medium text-ink-deep">Monthly summary</div> <svg viewBox="0 0 200 60" className="mt-3 h-16 w-full"><polyline points="0,50 30,40 60,44 90,25 120,30 150,12 200,18" fill="none" stroke="var(--color-accent)" strokeWidth="2" /></svg> <div className="mt-2 flex justify-between text-micro text-ink-faint"><span>Region</span><span>Revenue</span></div> <div className="mt-2 flex justify-between"><Bar w="w-20" /><Bar w="w-14" /></div> </div> ); } function Card({ item }: { item: Item }) { const [hover, setHover] = useState(false); return ( <article onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)} className="group overflow-hidden rounded-xs border border-hairline bg-surface transition-colors duration-smooth ease-smooth hover:border-accent/50 focus-within:border-accent/50" > <div className="min-h-[130px] p-6"> <h3 className="text-h3 text-accent group-hover:underline">{item.name}</h3> <p className="mt-1 text-body text-ink-muted">{item.desc}</p> </div> <div className="h-[180px] overflow-hidden border-t border-hairline bg-surface-tint"> <div className={`transition-transform duration-smooth ease-smooth ${hover ? "-translate-y-1.5" : ""}`}> <Mini kind={item.kind} /> </div> </div> </article> ); } export default function ProductCatalogCard({ title = "Sell and grow in every market", intro = "Reach buyers on any channel, from storefronts to assistants, with local methods and currencies built in.", items = DEFAULTS, }: { title?: string; intro?: string; items?: Item[] }) { return ( <section className="bg-canvas px-4 py-16 md:px-8"> <div className="mx-auto max-w-6xl"> <h2 className="text-h2 text-ink-deep">{title}</h2> <p className="mt-2 max-w-xl text-lead text-ink-muted">{intro}</p> <Reveal className="mt-12 grid gap-6 md:grid-cols-2"> {items.map((it) => ( <Card key={it.name} item={it} /> ))} </Reveal> </div> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal ---- const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)"; const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect; function ykReducedMotion(): boolean { return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches; } // "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance. // Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed, // and there is a box to watch), and a safety net reveals anything on screen that is still hidden. type YkRevealState = "idle" | "hidden" | "shown"; function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState { const [state, setState] = useState<YkRevealState>("idle"); useYkLayoutEffect(() => { const el = ref.current; if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return; // watch the element's own box, or its children when it has none (display: contents) const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]); const onScreen = (t: Element) => { const r = t.getBoundingClientRect(); return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth; }; if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible let shown = false; const show = (v: boolean) => { if (v !== shown) (shown = v), setState(v ? "shown" : "hidden"); }; setState("hidden"); const inView = new Set<Element>(); const io = new IntersectionObserver((entries) => { for (const e of entries) { if (e.isIntersecting) inView.add(e.target); else inView.delete(e.target); } if (inView.size) { show(true); if (once) io.disconnect(); } else if (!once) show(false); }); const watched = new Set<Element>(); const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t))); watch(); // safety net: styles that land after mount (display: contents) get watched too, and nothing // stays hidden for more than a moment while it is actually on screen const start = Date.now(); const net = setInterval(() => { if (shown) return once && clearInterval(net); watch(); if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true); }, 600); return () => { io.disconnect(); clearInterval(net); }; }, [once]); return state; } type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none"; /** Fades content in as it scrolls into view. */ function Reveal({ children, from = "up", delay = 0, duration = 700, distance = 24, once = true, as = "div", className, style, }: { children?: ReactNode; from?: YkRevealFrom; delay?: number; duration?: number; distance?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); const hidden = state === "hidden"; const offset = { up: `translate3d(0, ${distance}px, 0)`, down: `translate3d(0, ${-distance}px, 0)`, left: `translate3d(${-distance}px, 0, 0)`, right: `translate3d(${distance}px, 0, 0)`, scale: "scale(0.94)", blur: `translate3d(0, ${distance / 2}px, 0)`, none: "none", }[from]; const t = `${duration}ms ${YK_EASE} ${delay}ms`; return ( <Tag ref={ref} className={className} style={{ ...style, ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }), ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }), }} > {children} </Tag> ); }"use client"; import { useEffect, useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useState } from "react"; type Item = { name: string; desc: string; kind: "chat" | "form" | "list" | "chart" }; const DEFAULTS: Item[] = [ { name: "Concierge", desc: "Let shoppers find and order through assistants while keeping every order protected.", kind: "chat" }, { name: "Basket", desc: "A fast, brandable purchase page that lifts completed orders for most teams within weeks.", kind: "form" }, { name: "Vault", desc: "Saved profiles fill in details so returning buyers finish in seconds.", kind: "list" }, { name: "Insights", desc: "Track revenue trends, refunds and regional performance in a single clear view.", kind: "chart" }, ]; function Bar({ w = "w-24" }: { w?: string }) { return <div className={`h-1.5 rounded-full bg-primary/10 ${w}`} />; } function Mini({ kind }: { kind: Item["kind"] }) { if (kind === "chat") return ( <div className="flex flex-col gap-3 px-6 pt-6"> <div className="self-end rounded-sm border border-border bg-card px-4 py-2 text-iridescent-ui text-foreground">I need a green notebook</div> <div className="text-iridescent-ui text-foreground">Here is what I found:</div> <div className="flex items-center justify-between rounded-sm border border-border bg-card p-4"> <div className="flex items-center gap-3"><div className="h-9 w-9 rounded-sm bg-primary/10" /><div className="space-y-2"><Bar w="w-28" /><Bar w="w-20" /></div></div> <div className="rounded-full border border-border px-3 py-1 text-iridescent-caption text-foreground">− 1 +</div> </div> </div> ); if (kind === "form") return ( <div className="mx-auto w-[72%] space-y-3 border-x border-border bg-card px-6 pt-6"> <div className="text-iridescent-caption text-foreground">Email address</div> <div className="h-9 rounded-sm border border-border" /> <div className="text-iridescent-caption text-foreground">Payment</div> <div className="flex h-10 items-center justify-between rounded-sm border border-border px-3"><Bar /><div className="flex gap-1"><i className="h-2.5 w-4 rounded-[2px] bg-primary" /><i className="h-2.5 w-4 rounded-[2px] bg-iridescent-signal-orange" /><i className="h-2.5 w-4 rounded-[2px] bg-iridescent-signal-magenta" /></div></div> </div> ); if (kind === "list") return ( <div className="mx-auto w-[72%] space-y-2 bg-card p-3 pb-0"> <div className="flex items-center justify-between"><div className="text-iridescent-ui text-muted-foreground font-medium">Wallet</div><div className="text-muted-foreground">×</div></div> <div className="flex items-center gap-3 rounded-sm bg-muted p-3"><i className="h-3 w-3 rounded-full bg-primary" /><span className="text-iridescent-ui text-foreground">•••• 1881</span></div> <div className="flex items-center gap-3 p-3"><i className="h-3 w-3 rounded-full border border-border" /><Bar w="w-28" /></div> </div> ); return ( <div className="mx-auto w-[80%] rounded-sm border border-border bg-card p-5 pb-0"> <div className="text-iridescent-ui font-medium text-muted-foreground">Monthly summary</div> <svg viewBox="0 0 200 60" className="mt-3 h-16 w-full"><polyline points="0,50 30,40 60,44 90,25 120,30 150,12 200,18" fill="none" stroke="var(--color-primary)" strokeWidth="2" /></svg> <div className="mt-2 flex justify-between text-iridescent-micro text-muted-foreground"><span>Region</span><span>Revenue</span></div> <div className="mt-2 flex justify-between"><Bar w="w-20" /><Bar w="w-14" /></div> </div> ); } function Card({ item }: { item: Item }) { const [hover, setHover] = useState(false); return ( <article onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)} className="group overflow-hidden rounded-sm border border-border bg-card transition-colors duration-iridescent-smooth ease-iridescent-smooth hover:border-primary/50 focus-within:border-primary/50" > <div className="min-h-[130px] p-6"> <h3 className="text-iridescent-h3 text-primary group-hover:underline">{item.name}</h3> <p className="mt-1 text-iridescent-body text-muted-foreground">{item.desc}</p> </div> <div className="h-[180px] overflow-hidden border-t border-border bg-muted"> <div className={`transition-transform duration-iridescent-smooth ease-iridescent-smooth ${hover ? "-translate-y-1.5" : ""}`}> <Mini kind={item.kind} /> </div> </div> </article> ); } export default function ProductCatalogCard({ title = "Sell and grow in every market", intro = "Reach buyers on any channel, from storefronts to assistants, with local methods and currencies built in.", items = DEFAULTS, }: { title?: string; intro?: string; items?: Item[] }) { return ( <section className="bg-background px-4 py-16 md:px-8"> <div className="mx-auto max-w-6xl"> <h2 className="text-iridescent-h2 text-muted-foreground">{title}</h2> <p className="mt-2 max-w-xl text-iridescent-lead text-muted-foreground">{intro}</p> <Reveal className="mt-12 grid gap-6 md:grid-cols-2"> {items.map((it) => ( <Card key={it.name} item={it} /> ))} </Reveal> </div> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal ---- const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)"; const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect; function ykReducedMotion(): boolean { return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches; } // "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance. // Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed, // and there is a box to watch), and a safety net reveals anything on screen that is still hidden. type YkRevealState = "idle" | "hidden" | "shown"; function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState { const [state, setState] = useState<YkRevealState>("idle"); useYkLayoutEffect(() => { const el = ref.current; if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return; // watch the element's own box, or its children when it has none (display: contents) const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]); const onScreen = (t: Element) => { const r = t.getBoundingClientRect(); return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth; }; if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible let shown = false; const show = (v: boolean) => { if (v !== shown) (shown = v), setState(v ? "shown" : "hidden"); }; setState("hidden"); const inView = new Set<Element>(); const io = new IntersectionObserver((entries) => { for (const e of entries) { if (e.isIntersecting) inView.add(e.target); else inView.delete(e.target); } if (inView.size) { show(true); if (once) io.disconnect(); } else if (!once) show(false); }); const watched = new Set<Element>(); const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t))); watch(); // safety net: styles that land after mount (display: contents) get watched too, and nothing // stays hidden for more than a moment while it is actually on screen const start = Date.now(); const net = setInterval(() => { if (shown) return once && clearInterval(net); watch(); if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true); }, 600); return () => { io.disconnect(); clearInterval(net); }; }, [once]); return state; } type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none"; /** Fades content in as it scrolls into view. */ function Reveal({ children, from = "up", delay = 0, duration = 700, distance = 24, once = true, as = "div", className, style, }: { children?: ReactNode; from?: YkRevealFrom; delay?: number; duration?: number; distance?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); const hidden = state === "hidden"; const offset = { up: `translate3d(0, ${distance}px, 0)`, down: `translate3d(0, ${-distance}px, 0)`, left: `translate3d(${-distance}px, 0, 0)`, right: `translate3d(${distance}px, 0, 0)`, scale: "scale(0.94)", blur: `translate3d(0, ${distance / 2}px, 0)`, none: "none", }[from]; const t = `${duration}ms ${YK_EASE} ${delay}ms`; return ( <Tag ref={ref} className={className} style={{ ...style, ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }), ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }), }} > {children} </Tag> ); }
Quality checks
Automated, in a real browser · 5d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: passedIts animation plays and finishes with everything visible, and it stays still for people who turn on reduced motion.