Customer Story Showcase
A section lead with heading, purple button and right-aligned paragraph, then a featured story row with a logo tile, title and outlined 'Read the story' link, over a wide 21:9 aerial photo with a three-fact stat strip. Below, collapsed stories sit on dashed hairlines with plus chip toggles.
Rebuilt from stripe.com 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: heading, intro, ctaLabel, featuredTitle, featuredImage, stats, and stories (title, mark, detail, image). Click a plus chip to expand a story row and reveal its photo; hover 'Read the story' to cross-fade label and chevron.
components/customer-story-accordion.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; import { useState } from "react"; type Story = { title: string; mark: string; detail: string; image: string }; type Props = { heading?: string; intro?: string; ctaLabel?: string; featuredTitle?: string; featuredImage?: string; stats?: { value: string; label: string }[]; stories?: Story[]; }; const defaultStories: Story[] = [ { title: "Northwind consolidates retail revenue onto one platform.", mark: "N", detail: "Unified in-store and online reporting across every region.", image: "https://yoink-app.fly.dev/stock/city-3.jpg" }, { title: "Altura powers same-day delivery with flexible payouts.", mark: "A", detail: "Faster settlement for thousands of local couriers.", image: "https://yoink-app.fly.dev/stock/city-4.jpg" }, { title: "Kitefield improves cross-border checkout for readers.", mark: "K", detail: "Local payment methods lifted conversion in new markets.", image: "https://yoink-app.fly.dev/stock/architecture-2.jpg" }, ]; export default function CustomerStoryShowcase({ heading = "Scale your business with adaptable money tooling", intro = "Most large retailers have trialled our tools to grow, from opening new regions to rethinking how shoppers pay and return.", ctaLabel = "Explore for enterprise", featuredTitle = "Lumen Rentals brings every booking into one system.", featuredImage = "https://yoink-app.fly.dev/stock/city-3.jpg", stats = [ { value: "120", label: "countries" }, { value: "9K+", label: "branches worldwide" }, { value: "Products used", label: "Billing, Terminal, Connect and Reports" }, ], stories = defaultStories, }: Props) { const [open, setOpen] = useState<number | null>(null); const chev = ( <svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" strokeWidth="1.6" aria-hidden="true"><path d="M3 1.5 6.5 5 3 8.5" /></svg> ); return ( <section className="bg-canvas text-ink font-sans px-4 py-12 md:px-6"> <div className="mx-auto max-w-[1232px]"> <Reveal> <div className="grid gap-6 md:grid-cols-2"> <div> <h2 className="font-display text-h2 text-ink-deep max-w-md">{heading}</h2> <a href="#" className="mt-6 inline-flex items-center gap-2 rounded-xs bg-accent px-6 py-3 text-ui text-white duration-link ease-link hover:bg-ink-deep focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent">{ctaLabel} {chev}</a> </div> <p className="text-lead text-ink-muted md:pl-8">{intro}</p> </div> </Reveal> <div className="mt-14 flex items-center gap-4"> <div className="flex h-10 w-10 items-center justify-center rounded-xs bg-signal-orange font-display text-lead text-ink-deep" aria-hidden="true">L</div> <h3 className="flex-1 text-h3 text-ink-deep">{featuredTitle}</h3> <a href="#" className="group relative hidden h-10 w-[140px] items-center justify-center rounded-xs border border-hairline bg-surface text-ui text-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent sm:flex"> <span className="duration-[400ms] ease-[cubic-bezier(0.3,0,0.2,1)] group-hover:opacity-0">Read the story</span> <span className="absolute opacity-0 duration-[400ms] ease-[cubic-bezier(0.3,0,0.2,1)] group-hover:opacity-100" aria-hidden="true">{chev}</span> </a> </div> <div className="relative mt-4 aspect-[21/9] overflow-hidden rounded-sm"> <img src={featuredImage} alt="Aerial view of a city district" width={1600} height={755} className="h-full w-full object-cover" /> </div> <dl className="mt-8 grid gap-3 text-ui text-ink-muted md:grid-cols-3"> {stats.map((s) => ( <div key={s.value}><dt className="inline font-medium text-ink-deep">{s.value} </dt><dd className="inline">{s.label}</dd></div> ))} </dl> <ul className="mt-10"> {stories.map((s, i) => { const isOpen = open === i; return ( <li key={s.title} className="border-t border-dashed border-hairline py-4"> <div className="flex items-center gap-4"> <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xs bg-night font-display text-lead text-white" aria-hidden="true">{s.mark}</div> <h4 className="flex-1 text-h3 text-ink">{s.title}</h4> <button type="button" aria-expanded={isOpen} aria-label={isOpen ? "Collapse story" : "Expand story"} onClick={() => setOpen(isOpen ? null : i)} className="flex h-10 w-10 items-center justify-center rounded-xs bg-accent-wash text-accent duration-smooth ease-smooth hover:bg-accent-soft focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent"> <svg width="14" height="14" viewBox="0 0 14 14" stroke="currentColor" strokeWidth="1.6" className={`duration-smooth ease-smooth ${isOpen ? "rotate-45" : ""}`} aria-hidden="true"><path d="M7 1v12M1 7h12" /></svg> </button> </div> <div className={`grid duration-[400ms] ease-[cubic-bezier(0.3,0,0.2,1)] ${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`}> <div className="overflow-hidden"> <p className="pt-4 text-body text-ink-muted">{s.detail}</p> <img src={s.image} alt="" loading="lazy" width={1600} height={755} className="mt-4 aspect-[21/9] w-full rounded-sm object-cover" /> </div> </div> </li> ); })} </ul> </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 Story = { title: string; mark: string; detail: string; image: string }; type Props = { heading?: string; intro?: string; ctaLabel?: string; featuredTitle?: string; featuredImage?: string; stats?: { value: string; label: string }[]; stories?: Story[]; }; const defaultStories: Story[] = [ { title: "Northwind consolidates retail revenue onto one platform.", mark: "N", detail: "Unified in-store and online reporting across every region.", image: "https://yoink-app.fly.dev/stock/city-3.jpg" }, { title: "Altura powers same-day delivery with flexible payouts.", mark: "A", detail: "Faster settlement for thousands of local couriers.", image: "https://yoink-app.fly.dev/stock/city-4.jpg" }, { title: "Kitefield improves cross-border checkout for readers.", mark: "K", detail: "Local payment methods lifted conversion in new markets.", image: "https://yoink-app.fly.dev/stock/architecture-2.jpg" }, ]; export default function CustomerStoryShowcase({ heading = "Scale your business with adaptable money tooling", intro = "Most large retailers have trialled our tools to grow, from opening new regions to rethinking how shoppers pay and return.", ctaLabel = "Explore for enterprise", featuredTitle = "Lumen Rentals brings every booking into one system.", featuredImage = "https://yoink-app.fly.dev/stock/city-3.jpg", stats = [ { value: "120", label: "countries" }, { value: "9K+", label: "branches worldwide" }, { value: "Products used", label: "Billing, Terminal, Connect and Reports" }, ], stories = defaultStories, }: Props) { const [open, setOpen] = useState<number | null>(null); const chev = ( <svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" strokeWidth="1.6" aria-hidden="true"><path d="M3 1.5 6.5 5 3 8.5" /></svg> ); return ( <section className="bg-background text-foreground font-sans px-4 py-12 md:px-6"> <div className="mx-auto max-w-[1232px]"> <Reveal> <div className="grid gap-6 md:grid-cols-2"> <div> <h2 className="font-sans text-iridescent-h2 text-muted-foreground max-w-md">{heading}</h2> <a href="#" className="mt-6 inline-flex items-center gap-2 rounded-sm bg-primary px-6 py-3 text-iridescent-ui text-primary-foreground duration-iridescent-link ease-iridescent-link hover:bg-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary">{ctaLabel} {chev}</a> </div> <p className="text-iridescent-lead text-muted-foreground md:pl-8">{intro}</p> </div> </Reveal> <div className="mt-14 flex items-center gap-4"> <div className="flex h-10 w-10 items-center justify-center rounded-sm bg-iridescent-signal-orange font-sans text-iridescent-lead text-muted-foreground" aria-hidden="true">L</div> <h3 className="flex-1 text-iridescent-h3 text-muted-foreground">{featuredTitle}</h3> <a href="#" className="group relative hidden h-10 w-[140px] items-center justify-center rounded-sm border border-border bg-card text-iridescent-ui text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary sm:flex"> <span className="duration-[400ms] ease-[cubic-bezier(0.3,0,0.2,1)] group-hover:opacity-0">Read the story</span> <span className="absolute opacity-0 duration-[400ms] ease-[cubic-bezier(0.3,0,0.2,1)] group-hover:opacity-100" aria-hidden="true">{chev}</span> </a> </div> <div className="relative mt-4 aspect-[21/9] overflow-hidden rounded-sm"> <img src={featuredImage} alt="Aerial view of a city district" width={1600} height={755} className="h-full w-full object-cover" /> </div> <dl className="mt-8 grid gap-3 text-iridescent-ui text-muted-foreground md:grid-cols-3"> {stats.map((s) => ( <div key={s.value}><dt className="inline font-medium text-muted-foreground">{s.value} </dt><dd className="inline">{s.label}</dd></div> ))} </dl> <ul className="mt-10"> {stories.map((s, i) => { const isOpen = open === i; return ( <li key={s.title} className="border-t border-dashed border-border py-4"> <div className="flex items-center gap-4"> <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-sm bg-primary font-sans text-iridescent-lead text-primary-foreground" aria-hidden="true">{s.mark}</div> <h4 className="flex-1 text-iridescent-h3 text-foreground">{s.title}</h4> <button type="button" aria-expanded={isOpen} aria-label={isOpen ? "Collapse story" : "Expand story"} onClick={() => setOpen(isOpen ? null : i)} className="flex h-10 w-10 items-center justify-center rounded-sm bg-primary/10 text-primary duration-iridescent-smooth ease-iridescent-smooth hover:bg-iridescent-accent-soft focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> <svg width="14" height="14" viewBox="0 0 14 14" stroke="currentColor" strokeWidth="1.6" className={`duration-iridescent-smooth ease-iridescent-smooth ${isOpen ? "rotate-45" : ""}`} aria-hidden="true"><path d="M7 1v12M1 7h12" /></svg> </button> </div> <div className={`grid duration-[400ms] ease-[cubic-bezier(0.3,0,0.2,1)] ${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}`}> <div className="overflow-hidden"> <p className="pt-4 text-iridescent-body text-muted-foreground">{s.detail}</p> <img src={s.image} alt="" loading="lazy" width={1600} height={755} className="mt-4 aspect-[21/9] w-full rounded-sm object-cover" /> </div> </div> </li> ); })} </ul> </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: not passedStays invisible after its animation: <div> "Unified in-store and online reporting ac"Stays invisible after its animation: <div> "Faster settlement for thousands of local"Stays invisible after its animation: <div> "Local payment methods lifted conversion "