Testimonial Marquee Cards
Horizontally drifting row of dark gradient cards with a quote, overlapping company-logo and portrait avatars, name and role. Cards have a hairline border and a top-lit gradient that fades into black at the bottom.
Rebuilt from resend.com/pricing in the Obsidian Serif Glow style.
npx shadcn@latest add https://justyoink.it/r/obsidian-serif-glow/blocks/testimonial-marquee.json
Looks exactly like resend.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/obsidian-serif-glow/mine/testimonial-marquee.json
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
Pass `items` (quote, name, role, logo shape, tint) and `speed` in px/s; renders with defaults and pauses on hover.
components/testimonial-marquee.tsx
"use client"; import { useEffect, useRef, useState, type CSSProperties, type ReactNode } from "react"; type Item = { quote: string; name: string; role: string; logo: string; tint: string }; const DEFAULTS: Item[] = [ { quote: "\"Our crew is tiny and every hour counts. Scheduling used to eat our mornings, and now it simply runs itself in the background.\"", name: "Marta Olsen", role: "Operations at Kitefield", logo: "circle", tint: "#3b82f6" }, { quote: "\"The smoothest rollout we have ever shipped. Nobody on the team had to relearn anything.\"", name: "Devon Reyes", role: "Platform Engineer at Altura", logo: "square", tint: "#22c55e" }, { quote: "\"Reliable from the first day, and the support replies faster than we can finish our coffee. It earned a permanent place in our stack.\"", name: "Ines Carvalho", role: "Head of Product at Northwind", logo: "tri", tint: "#f97316" }, { quote: "\"We replaced three tools with one and our dashboards finally agree with each other.\"", name: "Jonas Weber", role: "Founder at Lumen Labs", logo: "circle", tint: "#22d3ee" }, ]; function Mark({ kind, tint }: { kind: string; tint: string }) { return ( <span className="relative z-10 grid h-10 w-10 place-items-center rounded-full bg-surface-high ring-2 ring-background"> <svg width="18" height="18" viewBox="0 0 18 18" fill={tint} aria-hidden="true"> {kind === "circle" && <circle cx="9" cy="9" r="7" />} {kind === "square" && <rect x="2" y="2" width="14" height="14" rx="3" />} {kind === "tri" && <path d="M9 2l7 13H2z" />} </svg> </span> ); } export default function TestimonialMarqueeCards({ items = DEFAULTS, speed = 30 }: { items?: Item[]; speed?: number }) { return ( <section className="relative overflow-hidden bg-background py-10" aria-label="Customer testimonials"> <Marquee speed={speed} pauseOnHover gap={32}> {items.map((t, i) => ( <figure key={i} className="relative flex h-[170px] w-[420px] shrink-0 flex-col justify-between overflow-hidden rounded-xl border border-hairline bg-[linear-gradient(rgba(80,80,80,0.15)_0%,rgba(0,0,0,0)_70%)] p-8"> <blockquote className="text-ui text-secondary">{t.quote}</blockquote> <figcaption className="mt-4 flex items-center"> <Mark kind={t.logo} tint={t.tint} /> <span className="-ml-2 grid h-10 w-10 place-items-center rounded-full bg-gradient-to-br from-accent-blue to-accent-orange text-caption text-primary ring-2 ring-background"> {t.name.split(" ").map((w) => w[0]).join("")} </span> <span className="ml-4"> <span className="block text-ui text-primary">{t.name}</span> <span className="block text-ui text-secondary">{t.role}</span> </span> </figcaption> </figure> ))} </Marquee> <div aria-hidden="true" className="pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-[linear-gradient(rgba(0,0,0,0)_0%,#000_100%)]" /> </section> ); } // ---- Yoink motion (inlined, no dependencies): Marquee ---- const YK_MARQUEE_CSS = `@keyframes yk-marquee-x{to{transform:translate3d(calc(-1 * var(--yk-shift)),0,0)}} @keyframes yk-marquee-y{to{transform:translate3d(0,calc(-1 * var(--yk-shift)),0)}} [data-yk-marquee][data-pause]:hover [data-yk-track]{animation-play-state:paused} @media (prefers-reduced-motion:reduce){[data-yk-track]{animation:none!important}}`; /** An endless, seamless scrolling row (or column) of items: logos, quotes, tags. */ function Marquee({ children, speed = 40, reverse = false, vertical = false, pauseOnHover = true, fade = true, gap = 48, className, style, }: { children?: ReactNode; /** pixels per second */ speed?: number; reverse?: boolean; vertical?: boolean; pauseOnHover?: boolean; fade?: boolean; gap?: number; className?: string; style?: CSSProperties; }) { const box = useRef<HTMLDivElement>(null); const group = useRef<HTMLDivElement>(null); const [m, setM] = useState({ copies: 2, size: 0 }); useEffect(() => { const measure = () => { const b = box.current, g = group.current; if (!b || !g) return; const size = vertical ? g.offsetHeight : g.offsetWidth; const room = vertical ? b.offsetHeight : b.offsetWidth; if (size > 0) setM({ size, copies: Math.max(2, Math.ceil(room / size) + 1) }); }; measure(); const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null; if (box.current) ro?.observe(box.current); if (group.current) ro?.observe(group.current); return () => ro?.disconnect(); }, [vertical]); // the copies are only there to fill the loop: hide them from screen readers and keyboards useEffect(() => { box.current?.querySelectorAll("[data-yk-copy]").forEach((el) => el.setAttribute("inert", "")); }, [m.copies]); const edge = vertical ? "to bottom" : "to right"; const mask = fade ? `linear-gradient(${edge}, transparent, black 10%, black 90%, transparent)` : undefined; const dir = vertical ? "column" : "row"; const items = (copy: number) => ( <div key={copy} ref={copy === 0 ? group : undefined} data-yk-copy={copy > 0 ? "" : undefined} aria-hidden={copy > 0 || undefined} style={{ display: "flex", flexDirection: dir, flexShrink: 0, alignItems: "center", gap, [vertical ? "paddingBottom" : "paddingRight"]: gap }} > {children} </div> ); return ( <div ref={box} data-yk-marquee="" data-pause={pauseOnHover ? "" : undefined} className={className} style={{ overflow: "hidden", maskImage: mask, WebkitMaskImage: mask, ...style }} > <style>{YK_MARQUEE_CSS}</style> <div data-yk-track="" style={{ display: "flex", flexDirection: dir, width: vertical ? "100%" : "max-content", ["--yk-shift" as string]: `${m.size}px`, animation: m.size ? `yk-marquee-${vertical ? "y" : "x"} ${m.size / Math.max(speed, 1)}s linear infinite${reverse ? " reverse" : ""}` : undefined, }} > {Array.from({ length: m.copies }, (_, i) => items(i))} </div> </div> ); }"use client"; import { useEffect, useRef, useState, type CSSProperties, type ReactNode } from "react"; type Item = { quote: string; name: string; role: string; logo: string; tint: string }; const DEFAULTS: Item[] = [ { quote: "\"Our crew is tiny and every hour counts. Scheduling used to eat our mornings, and now it simply runs itself in the background.\"", name: "Marta Olsen", role: "Operations at Kitefield", logo: "circle", tint: "#3b82f6" }, { quote: "\"The smoothest rollout we have ever shipped. Nobody on the team had to relearn anything.\"", name: "Devon Reyes", role: "Platform Engineer at Altura", logo: "square", tint: "#22c55e" }, { quote: "\"Reliable from the first day, and the support replies faster than we can finish our coffee. It earned a permanent place in our stack.\"", name: "Ines Carvalho", role: "Head of Product at Northwind", logo: "tri", tint: "#f97316" }, { quote: "\"We replaced three tools with one and our dashboards finally agree with each other.\"", name: "Jonas Weber", role: "Founder at Lumen Labs", logo: "circle", tint: "#22d3ee" }, ]; function Mark({ kind, tint }: { kind: string; tint: string }) { return ( <span className="relative z-10 grid h-10 w-10 place-items-center rounded-full bg-muted ring-2 ring-background"> <svg width="18" height="18" viewBox="0 0 18 18" fill={tint} aria-hidden="true"> {kind === "circle" && <circle cx="9" cy="9" r="7" />} {kind === "square" && <rect x="2" y="2" width="14" height="14" rx="3" />} {kind === "tri" && <path d="M9 2l7 13H2z" />} </svg> </span> ); } export default function TestimonialMarqueeCards({ items = DEFAULTS, speed = 30 }: { items?: Item[]; speed?: number }) { return ( <section className="relative overflow-hidden bg-background py-10" aria-label="Customer testimonials"> <Marquee speed={speed} pauseOnHover gap={32}> {items.map((t, i) => ( <figure key={i} className="relative flex h-[170px] w-[420px] shrink-0 flex-col justify-between overflow-hidden rounded-2xl border border-border bg-[linear-gradient(rgba(80,80,80,0.15)_0%,rgba(0,0,0,0)_70%)] p-8"> <blockquote className="text-obsidian-ui text-muted-foreground">{t.quote}</blockquote> <figcaption className="mt-4 flex items-center"> <Mark kind={t.logo} tint={t.tint} /> <span className="-ml-2 grid h-10 w-10 place-items-center rounded-full bg-gradient-to-br from-primary to-obsidian-accent-orange text-obsidian-caption text-foreground ring-2 ring-background"> {t.name.split(" ").map((w) => w[0]).join("")} </span> <span className="ml-4"> <span className="block text-obsidian-ui text-foreground">{t.name}</span> <span className="block text-obsidian-ui text-muted-foreground">{t.role}</span> </span> </figcaption> </figure> ))} </Marquee> <div aria-hidden="true" className="pointer-events-none absolute inset-x-0 bottom-0 h-1/2 bg-[linear-gradient(rgba(0,0,0,0)_0%,#000_100%)]" /> </section> ); } // ---- Yoink motion (inlined, no dependencies): Marquee ---- const YK_MARQUEE_CSS = `@keyframes yk-marquee-x{to{transform:translate3d(calc(-1 * var(--yk-shift)),0,0)}} @keyframes yk-marquee-y{to{transform:translate3d(0,calc(-1 * var(--yk-shift)),0)}} [data-yk-marquee][data-pause]:hover [data-yk-track]{animation-play-state:paused} @media (prefers-reduced-motion:reduce){[data-yk-track]{animation:none!important}}`; /** An endless, seamless scrolling row (or column) of items: logos, quotes, tags. */ function Marquee({ children, speed = 40, reverse = false, vertical = false, pauseOnHover = true, fade = true, gap = 48, className, style, }: { children?: ReactNode; /** pixels per second */ speed?: number; reverse?: boolean; vertical?: boolean; pauseOnHover?: boolean; fade?: boolean; gap?: number; className?: string; style?: CSSProperties; }) { const box = useRef<HTMLDivElement>(null); const group = useRef<HTMLDivElement>(null); const [m, setM] = useState({ copies: 2, size: 0 }); useEffect(() => { const measure = () => { const b = box.current, g = group.current; if (!b || !g) return; const size = vertical ? g.offsetHeight : g.offsetWidth; const room = vertical ? b.offsetHeight : b.offsetWidth; if (size > 0) setM({ size, copies: Math.max(2, Math.ceil(room / size) + 1) }); }; measure(); const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(measure) : null; if (box.current) ro?.observe(box.current); if (group.current) ro?.observe(group.current); return () => ro?.disconnect(); }, [vertical]); // the copies are only there to fill the loop: hide them from screen readers and keyboards useEffect(() => { box.current?.querySelectorAll("[data-yk-copy]").forEach((el) => el.setAttribute("inert", "")); }, [m.copies]); const edge = vertical ? "to bottom" : "to right"; const mask = fade ? `linear-gradient(${edge}, transparent, black 10%, black 90%, transparent)` : undefined; const dir = vertical ? "column" : "row"; const items = (copy: number) => ( <div key={copy} ref={copy === 0 ? group : undefined} data-yk-copy={copy > 0 ? "" : undefined} aria-hidden={copy > 0 || undefined} style={{ display: "flex", flexDirection: dir, flexShrink: 0, alignItems: "center", gap, [vertical ? "paddingBottom" : "paddingRight"]: gap }} > {children} </div> ); return ( <div ref={box} data-yk-marquee="" data-pause={pauseOnHover ? "" : undefined} className={className} style={{ overflow: "hidden", maskImage: mask, WebkitMaskImage: mask, ...style }} > <style>{YK_MARQUEE_CSS}</style> <div data-yk-track="" style={{ display: "flex", flexDirection: dir, width: vertical ? "100%" : "max-content", ["--yk-shift" as string]: `${m.size}px`, animation: m.size ? `yk-marquee-${vertical ? "y" : "x"} ${m.size / Math.max(speed, 1)}s linear infinite${reverse ? " reverse" : ""}` : undefined, }} > {Array.from({ length: m.copies }, (_, i) => items(i))} </div> </div> ); }
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.