Cards & content / Cards

Customer Story Logo Cards

Four-up surface cards with title text, muted date, and a 16:9 sunken well holding a large dark customer wordmark centered.

Rebuilt from cursor.com/blog in the Warm Paper Editorial style.

npx shadcn@latest add https://justyoink.it/r/warm-paper-editorial/blocks/customer-story-cards.json

Looks exactly like cursor.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Usage

Pass `heading` and a `stories` array of {title, date, brand, mark} (mark: ring | square | bars | dot). Renders standalone with defaults; cards tint 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; date: string; brand: string; mark: "ring" | "square" | "bars" | "dot" };

const defaults: Story[] = [
  { title: "Harbor cuts a quarter-long rollout down to two weeks, without pausing releases", date: "Oct 16, 2026", brand: "Harbor", mark: "ring" },
  { title: "How Lumen put automation in the hands of Design, Sales, and Support", date: "Sep 15, 2026", brand: "Lumen", mark: "dot" },
  { title: "How Kitefield builds long-running billing workflows with agents", date: "Sep 4, 2026", brand: "Kitefield", mark: "square" },
  { title: "Altura reviews 40M+ lines of code in under a month", date: "Sep 2, 2026", brand: "ALTURA", mark: "bars" },
];

function Mark({ type }: { type: Story["mark"] }) {
  const c = "h-8 w-8 shrink-0";
  if (type === "ring") return <span className={c + " rounded-full border-[6px] border-ink"} />;
  if (type === "square") return <span className={c + " rounded-md bg-ink"} />;
  if (type === "dot") return <span className={c + " rounded-full bg-ink"} />;
  return (
    <svg viewBox="0 0 32 32" className={c} aria-hidden="true">
      <path d="M2 30 16 2l14 28h-8L16 16l-6 14z" fill="currentColor" className="text-ink" />
    </svg>
  );
}

export default function CustomerStoryLogoCards({ heading = "Customer stories", stories = defaults }: { heading?: string; stories?: Story[] }) {
  return (
    <section className="bg-canvas px-6 py-12 font-sans text-ink md:px-[70px]">
      <h2 className="mb-8 text-h2 text-ink">{heading}</h2>
      <Stagger step={90} from="up" className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">
        {stories.map((s) => (
          <a key={s.title} href="#" className="group flex flex-col gap-3 rounded-xs border border-hairline bg-surface p-[17px] transition-colors duration-hover-color ease-hover-color hover:bg-surface-sunken focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink">
            <div className="min-h-[72px]">
              <h3 className="text-body text-ink">{s.title}</h3>
            </div>
            <p className="text-body text-ink-faint">{s.date}</p>
            <div className="mt-3 flex aspect-video items-center justify-center gap-2 rounded-xs bg-surface-sunken text-ink">
              <Mark type={s.mark} />
              <span className="text-h2 font-semibold tracking-tight">{s.brand}</span>
            </div>
          </a>
        ))}
      </Stagger>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): 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;
}

/** 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
—

More from Warm Paper Editorial

The whole style →

Ink and Ghost Pill Buttons

Buttons

Quote Card Grid

Testimonials

Terminal Install Chip

Code blocks

Dated Blog Index Table

Lists

Hairline Chevron Accordion

FAQ

Centered Pull Quote

Text effects