Customer Story Cards
Three-up grid of flat dark cards with hairline borders, a white logo mark at top, bold two-to-three line story title and a 'Read story' link with chevron. Centered page title and subhead above, and a pill 'Want to onboard your team? Contact us →' bar below.
Rebuilt from raycast.com/customers in the Obsidian Launcher style.
Looks exactly like raycast.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, subheading, stories (array of {title, href, mark: 'bolt'|'drop'|'disc'}), ctaText, ctaLink, ctaHref. Renders standalone with defaults; cards swap radial highlight and nudge the chevron on hover.
components/customer-story-cards.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Story = { title: string; href?: string; mark: "bolt" | "drop" | "disc" }; type Props = { heading?: string; subheading?: string; stories?: Story[]; ctaText?: string; ctaLink?: string; ctaHref?: string; }; const defaultStories: Story[] = [ { title: "How Northwind Uses Altura to Ship Support Tooling Faster", mark: "bolt" }, { title: "How Kitefield cuts review time across every release", mark: "drop" }, { title: "How Lumen Keeps Design and Docs Perfectly in Sync", mark: "disc" }, ]; function Mark({ type }: { type: Story["mark"] }) { return ( <svg width="60" height="60" viewBox="0 0 60 60" aria-hidden="true" className="text-primary"> {type === "bolt" && <path d="M4 6h34a16 16 0 0 1 4 31l14 17H38L26 40H18v14H4z" fill="currentColor" />} {type === "drop" && <path d="M30 2c8 12 18 20 18 33a18 18 0 0 1-36 0C12 22 22 14 30 2z" fill="currentColor" />} {type === "disc" && ( <> <circle cx="30" cy="30" r="30" fill="currentColor" /> <path d="M19 17h14a9 9 0 0 1 3 17l7 10h-8l-6-9h-3v9h-7z M26 24v5h6a2.5 2.5 0 0 0 0-5z" fill="#111214" fillRule="evenodd" /> </> )} </svg> ); } export default function CustomerStoryCards({ heading = "Customers", subheading = "Discover how teams and companies everywhere rely on our tools to simplify their daily work and move faster together.", stories = defaultStories, ctaText = "Want to onboard your team?", ctaLink = "Contact us", ctaHref = "#", }: Props) { return ( <section className="bg-canvas px-4 py-20 font-sans text-primary md:py-28"> <div className="mx-auto max-w-[1044px]"> <Reveal from="up" className="mx-auto max-w-xl text-center"> <h2 className="bg-gradient-to-b from-primary to-tertiary bg-clip-text text-5xl font-semibold tracking-[-0.02em] text-transparent"> {heading} </h2> <p className="mt-5 text-body-lg text-secondary">{subheading}</p> </Reveal> <Stagger step={100} className="mt-16 grid gap-8 md:grid-cols-3"> {stories.map((s, i) => ( <a key={i} href={s.href ?? "#"} className="group relative flex min-h-[296px] flex-col justify-between overflow-hidden rounded-lg border border-white/5 bg-surface p-8 transition-all duration-300 hover:border-white/10 hover:shadow-[0_20px_40px_rgba(0,0,0,0.1)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-red" > <span aria-hidden="true" className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,rgba(255,255,255,0.05),transparent_70%)] opacity-100 transition-opacity duration-500 group-hover:opacity-0" /> <span aria-hidden="true" className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_30%_30%,rgba(255,255,255,0.08),transparent_70%)] opacity-0 transition-opacity duration-500 group-hover:opacity-100" /> <div className="relative"> <Mark type={s.mark} /> <h3 className="mt-12 text-xl font-semibold leading-[26px] tracking-[-0.01em]">{s.title}</h3> </div> <span className="relative mt-8 inline-flex items-center gap-1.5 text-ui text-tertiary transition-colors duration-300 group-hover:text-primary"> Read story <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" className="transition-transform duration-300 ease-out group-hover:translate-x-[3px]"> <path d="M4 2l4 4-4 4" /> </svg> </span> </a> ))} </Stagger> <Reveal from="up" className="mt-24 flex justify-center"> <a href={ctaHref} className="group inline-flex items-center gap-2 rounded-lg border border-white/5 bg-white/5 px-6 py-4 text-ui text-tertiary transition-colors duration-300 hover:bg-white/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-red" > {ctaText} <span className="inline-flex items-center gap-1.5 font-semibold text-primary"> {ctaLink} <svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" className="transition-transform duration-300 group-hover:translate-x-[3px]"> <path d="M2 7h10M8 3l4 4-4 4" /> </svg> </span> </a> </Reveal> </div> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal, Stagger ---- 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> ); } /** Reveals each direct child one after another when the group scrolls into view. */ function Stagger({ children, step = 90, from = "up", distance = 20, duration = 650, delay = 0, once = true, as = "div", className, style, }: { children?: ReactNode; step?: number; from?: "up" | "down" | "left" | "right" | "scale" | "fade"; distance?: number; duration?: number; delay?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); useYkLayoutEffect(() => { const items = Array.from(ref.current?.children ?? []) as HTMLElement[]; if (state === "idle") return; 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.92)", fade: "none", }[from]; if (state === "hidden") { for (const el of items) Object.assign(el.style, { transition: "none", opacity: "0", transform: offset }); return; } items.forEach((el, i) => { const t = `${duration}ms ${YK_EASE} ${delay + i * step}ms`; Object.assign(el.style, { transition: `opacity ${t}, transform ${t}`, opacity: "", transform: "" }); }); // hand the children their own transitions back once everything has landed const done = setTimeout(() => items.forEach((el) => (el.style.transition = "")), delay + items.length * step + duration + 50); return () => clearTimeout(done); }, [state]); return ( <Tag ref={ref} className={className} style={style}> {children} </Tag> ); }"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Story = { title: string; href?: string; mark: "bolt" | "drop" | "disc" }; type Props = { heading?: string; subheading?: string; stories?: Story[]; ctaText?: string; ctaLink?: string; ctaHref?: string; }; const defaultStories: Story[] = [ { title: "How Northwind Uses Altura to Ship Support Tooling Faster", mark: "bolt" }, { title: "How Kitefield cuts review time across every release", mark: "drop" }, { title: "How Lumen Keeps Design and Docs Perfectly in Sync", mark: "disc" }, ]; function Mark({ type }: { type: Story["mark"] }) { return ( <svg width="60" height="60" viewBox="0 0 60 60" aria-hidden="true" className="text-foreground"> {type === "bolt" && <path d="M4 6h34a16 16 0 0 1 4 31l14 17H38L26 40H18v14H4z" fill="currentColor" />} {type === "drop" && <path d="M30 2c8 12 18 20 18 33a18 18 0 0 1-36 0C12 22 22 14 30 2z" fill="currentColor" />} {type === "disc" && ( <> <circle cx="30" cy="30" r="30" fill="currentColor" /> <path d="M19 17h14a9 9 0 0 1 3 17l7 10h-8l-6-9h-3v9h-7z M26 24v5h6a2.5 2.5 0 0 0 0-5z" fill="var(--color-card)" fillRule="evenodd" /> </> )} </svg> ); } export default function CustomerStoryCards({ heading = "Customers", subheading = "Discover how teams and companies everywhere rely on our tools to simplify their daily work and move faster together.", stories = defaultStories, ctaText = "Want to onboard your team?", ctaLink = "Contact us", ctaHref = "#", }: Props) { return ( <section className="bg-background px-4 py-20 font-sans text-foreground md:py-28"> <div className="mx-auto max-w-[1044px]"> <Reveal from="up" className="mx-auto max-w-xl text-center"> <h2 className="bg-gradient-to-b from-foreground to-foreground bg-clip-text text-5xl font-semibold tracking-[-0.02em] text-transparent"> {heading} </h2> <p className="mt-5 text-obsidian-body-lg text-muted-foreground">{subheading}</p> </Reveal> <Stagger step={100} className="mt-16 grid gap-8 md:grid-cols-3"> {stories.map((s, i) => ( <a key={i} href={s.href ?? "#"} className="group relative flex min-h-[296px] flex-col justify-between overflow-hidden rounded-xl border border-foreground/5 bg-card p-8 transition-all duration-300 hover:border-foreground/10 hover:shadow-[0_20px_40px_rgba(0,0,0,0.1)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary" > <span aria-hidden="true" className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,rgba(255,255,255,0.05),transparent_70%)] opacity-100 transition-opacity duration-500 group-hover:opacity-0" /> <span aria-hidden="true" className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_30%_30%,rgba(255,255,255,0.08),transparent_70%)] opacity-0 transition-opacity duration-500 group-hover:opacity-100" /> <div className="relative"> <Mark type={s.mark} /> <h3 className="mt-12 text-xl font-semibold leading-[26px] tracking-[-0.01em]">{s.title}</h3> </div> <span className="relative mt-8 inline-flex items-center gap-1.5 text-obsidian-ui text-muted-foreground transition-colors duration-300 group-hover:text-foreground"> Read story <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" className="transition-transform duration-300 ease-out group-hover:translate-x-[3px]"> <path d="M4 2l4 4-4 4" /> </svg> </span> </a> ))} </Stagger> <Reveal from="up" className="mt-24 flex justify-center"> <a href={ctaHref} className="group inline-flex items-center gap-2 rounded-xl border border-foreground/5 bg-foreground/5 px-6 py-4 text-obsidian-ui text-muted-foreground transition-colors duration-300 hover:bg-foreground/10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary" > {ctaText} <span className="inline-flex items-center gap-1.5 font-semibold text-foreground"> {ctaLink} <svg width="14" height="14" viewBox="0 0 14 14" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true" className="transition-transform duration-300 group-hover:translate-x-[3px]"> <path d="M2 7h10M8 3l4 4-4 4" /> </svg> </span> </a> </Reveal> </div> </section> ); } // ---- Yoink motion (inlined, no dependencies): Reveal, Stagger ---- 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> ); } /** Reveals each direct child one after another when the group scrolls into view. */ function Stagger({ children, step = 90, from = "up", distance = 20, duration = 650, delay = 0, once = true, as = "div", className, style, }: { children?: ReactNode; step?: number; from?: "up" | "down" | "left" | "right" | "scale" | "fade"; distance?: number; duration?: number; delay?: number; once?: boolean; as?: ElementType; className?: string; style?: CSSProperties; }) { const Tag = as; const ref = useRef<HTMLElement>(null); const state = useYkReveal(ref, once); useYkLayoutEffect(() => { const items = Array.from(ref.current?.children ?? []) as HTMLElement[]; if (state === "idle") return; 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.92)", fade: "none", }[from]; if (state === "hidden") { for (const el of items) Object.assign(el.style, { transition: "none", opacity: "0", transform: offset }); return; } items.forEach((el, i) => { const t = `${duration}ms ${YK_EASE} ${delay + i * step}ms`; Object.assign(el.style, { transition: `opacity ${t}, transform ${t}`, opacity: "", transform: "" }); }); // hand the children their own transitions back once everything has landed const done = setTimeout(() => items.forEach((el) => (el.style.transition = "")), delay + items.length * step + duration + 50); return () => clearTimeout(done); }, [state]); return ( <Tag ref={ref} className={className} style={style}> {children} </Tag> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: not passedElements must meet minimum color contrast ratio thresholds (1 element)
- 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.