Photo Testimonial Carousel
Wide 2:1 rounded photo card with portrait on right, left-side dark gradient scrim holding a tag chip, quote in 21px type and name/title; three segmented line progress indicators below.
Rebuilt from mercury.com in the Twilight Ledger style.
npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/blocks/photo-quote-carousel.json
Looks exactly like mercury.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/twilight-ledger-0e1ecf/mine/photo-quote-carousel.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.
Images3 in this component. Swap any for a library image or one of your own.All images in this style →
Usage
Pass `slides` (tag, quote, name, role, image, optional position) and `interval` in ms. It auto-advances, and the segmented bars are clickable and fill for the active slide.
components/photo-quote-carousel.tsx
import { useEffect, useState } from "react"; type Slide = { tag: string; quote: string; name: string; role: string; image: string; position?: string }; const DEFAULT_SLIDES: Slide[] = [ { tag: "Logistics", quote: "Our team closes the books in minutes now. Everything lives in one calm place, and nothing slips through the cracks.", name: "Elias Marten", role: "Co-founder, Northwind", image: "https://yoink-app.fly.dev/stock/people-1.jpg", position: "70% 50%" }, { tag: "Studios", quote: "We stopped chasing invoices. The software does the quiet work so we can focus on making things.", name: "Sana Whitlock", role: "Director, Kitefield", image: "https://yoink-app.fly.dev/stock/people-6.jpg", position: "60% 50%" }, { tag: "Retail", quote: "Payments, payroll and planning finally feel like one product instead of five tools stitched together.", name: "Dario Okafor", role: "CEO, Altura", image: "https://yoink-app.fly.dev/stock/people-2.jpg", position: "50% 50%" }, ]; export default function PhotoTestimonialCarousel({ slides = DEFAULT_SLIDES, interval = 6000 }: { slides?: Slide[]; interval?: number }) { const [i, setI] = useState(0); useEffect(() => { const t = setTimeout(() => setI((n) => (n + 1) % slides.length), interval); return () => clearTimeout(t); }, [i, interval, slides.length]); return ( <section className="bg-canvas px-4 py-16 font-sans text-ink"> <div className="mx-auto max-w-5xl"> <div className="relative aspect-[4/5] overflow-hidden rounded-xl bg-surface sm:aspect-[2/1]"> {slides.map((s, k) => ( <img key={k} src={s.image} alt={`Portrait for ${s.name}`} width={1024} height={512} loading={k === 0 ? "eager" : "lazy"} style={{ objectPosition: s.position }} className={`absolute inset-0 h-full w-full object-cover transition-all duration-700 ${k === i ? "opacity-100 blur-0" : "opacity-0 blur-sm"}`} /> ))} <div className="absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent sm:bg-gradient-to-r sm:from-black/60 sm:via-black/25 sm:to-transparent" /> <span className="absolute left-8 top-8 rounded-xs bg-canvas px-2 py-1.5 text-label">{slides[i].tag}</span> <div className="absolute bottom-8 left-8 right-8 sm:right-auto sm:max-w-[390px]"> <div key={i} className="animate-blur-swap"> <blockquote className="text-[21px] leading-[1.2] tracking-tight">“{slides[i].quote}”</blockquote> <p className="mt-8 text-lead">{slides[i].name}</p> <p className="text-lead text-ink-muted">{slides[i].role}</p> </div> </div> </div> <div className="mx-auto mt-10 flex max-w-xl gap-2" role="tablist" aria-label="Testimonials"> {slides.map((s, k) => ( <button key={k} role="tab" aria-selected={k === i} aria-label={`Show testimonial from ${s.name}`} onClick={() => setI(k)} className="group relative h-[3px] flex-1 overflow-hidden rounded-pill bg-hairline focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent"> <span className="absolute inset-0 bg-ink" style={k === i ? { animation: `fillbar ${interval}ms linear forwards` } : { transform: k < i ? "scaleX(1)" : "scaleX(0)", transformOrigin: "left" }} /> </button> ))} </div> </div> <style>{`@keyframes fillbar{from{transform:scaleX(0);transform-origin:left}to{transform:scaleX(1);transform-origin:left}}`}</style> </section> ); }import { useEffect, useState } from "react"; type Slide = { tag: string; quote: string; name: string; role: string; image: string; position?: string }; const DEFAULT_SLIDES: Slide[] = [ { tag: "Logistics", quote: "Our team closes the books in minutes now. Everything lives in one calm place, and nothing slips through the cracks.", name: "Elias Marten", role: "Co-founder, Northwind", image: "https://yoink-app.fly.dev/stock/people-1.jpg", position: "70% 50%" }, { tag: "Studios", quote: "We stopped chasing invoices. The software does the quiet work so we can focus on making things.", name: "Sana Whitlock", role: "Director, Kitefield", image: "https://yoink-app.fly.dev/stock/people-6.jpg", position: "60% 50%" }, { tag: "Retail", quote: "Payments, payroll and planning finally feel like one product instead of five tools stitched together.", name: "Dario Okafor", role: "CEO, Altura", image: "https://yoink-app.fly.dev/stock/people-2.jpg", position: "50% 50%" }, ]; export default function PhotoTestimonialCarousel({ slides = DEFAULT_SLIDES, interval = 6000 }: { slides?: Slide[]; interval?: number }) { const [i, setI] = useState(0); useEffect(() => { const t = setTimeout(() => setI((n) => (n + 1) % slides.length), interval); return () => clearTimeout(t); }, [i, interval, slides.length]); return ( <section className="bg-background px-4 py-16 font-sans text-foreground"> <div className="mx-auto max-w-5xl"> <div className="relative aspect-[4/5] overflow-hidden rounded-2xl bg-card sm:aspect-[2/1]"> {slides.map((s, k) => ( <img key={k} src={s.image} alt={`Portrait for ${s.name}`} width={1024} height={512} loading={k === 0 ? "eager" : "lazy"} style={{ objectPosition: s.position }} className={`absolute inset-0 h-full w-full object-cover transition-all duration-700 ${k === i ? "opacity-100 blur-0" : "opacity-0 blur-sm"}`} /> ))} <div className="absolute inset-0 bg-gradient-to-t from-background/70 via-background/20 to-transparent sm:bg-gradient-to-r sm:from-background/60 sm:via-background/25 sm:to-transparent" /> <span className="absolute left-8 top-8 rounded-sm bg-background px-2 py-1.5 text-twilight-label">{slides[i].tag}</span> <div className="absolute bottom-8 left-8 right-8 sm:right-auto sm:max-w-[390px]"> <div key={i} className="animate-twilight-blur-swap"> <blockquote className="text-[21px] leading-[1.2] tracking-tight">“{slides[i].quote}”</blockquote> <p className="mt-8 text-twilight-lead">{slides[i].name}</p> <p className="text-twilight-lead text-muted-foreground">{slides[i].role}</p> </div> </div> </div> <div className="mx-auto mt-10 flex max-w-xl gap-2" role="tablist" aria-label="Testimonials"> {slides.map((s, k) => ( <button key={k} role="tab" aria-selected={k === i} aria-label={`Show testimonial from ${s.name}`} onClick={() => setI(k)} className="group relative h-[3px] flex-1 overflow-hidden rounded-full bg-border focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> <span className="absolute inset-0 bg-foreground" style={k === i ? { animation: `fillbar ${interval}ms linear forwards` } : { transform: k < i ? "scaleX(1)" : "scaleX(0)", transformOrigin: "left" }} /> </button> ))} </div> </div> <style>{`@keyframes fillbar{from{transform:scaleX(0);transform-origin:left}to{transform:scaleX(1);transform-origin:left}}`}</style> </section> ); }
Quality checks
Automated, in a real browser · 4d 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 passedNever appears with reduced motion on: <div> "“Our team closes the books in minutes no"