Cards & content / Cards

Three-Up Feature Card with Mockup Well

Stacked card on surface fill: ink title, muted description, orange 'Learn more →' link, then a square tinted well (stone, sage, slate, or pale) with a cropped floating UI vignette such as subagent lists, rules file, command palette or checkpoint timeline. Bottom edges often fade via mask.

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

npx shadcn@latest add https://justyoink.it/r/warm-paper-editorial/blocks/three-up-feature-card.json

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

Usage

Props: heading, subheading, and features (title, description, href, linkLabel) for the three cards. The mockup wells (task list, rules file, search trace) are built in and animate in on load.

components/three-up-feature-card.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
import { useState } from "react";

type Feature = { title: string; description: string; href: string; linkLabel: string };

export default function ThreeUpFeatureCards(props: {
  heading?: string;
  subheading?: string;
  features?: Feature[];
}) {
  const heading = props.heading ?? "Reads every corner of your project, at any scale";
  const subheading = props.subheading ?? "Northwind Studio maps your repository first, then starts making careful changes.";
  const features: Feature[] = props.features ?? [
    { title: "Parallel workers", description: "Several helpers tackle separate parts of a job at once, each picking the tool that fits.", href: "#", linkLabel: "Learn more" },
    { title: "Shared conventions", description: "Write down how your group builds things and every suggestion follows the same playbook.", href: "#", linkLabel: "Learn more" },
    { title: "Instant lookup", description: "Built for huge repositories, scanning vast numbers of files returns answers in a blink.", href: "#", linkLabel: "Learn more" },
  ];
  const [hover, setHover] = useState<number | null>(null);

  const tasks = [
    { t: "Draft billing schema", m: "Editing files • Model A", on: true },
    { t: "Onboarding checklist view", m: "Building page • Model B", on: true },
    { t: "Add retry coverage", m: "Writing tests • Model C", on: true },
    { t: "Polish release notes", m: "Pending • Model D", on: false },
  ];
  const steps = [
    ["Searched", "invoice reminder flow"],
    ["Read", "src/billing/Reminder.ts"],
    ["Read", "lib/mail/queue.ts"],
    ["Read", "db/invoices.ts"],
    ["Grepped", "sendReminder"],
  ];

  const Spinner = () => (
    <span className="h-3.5 w-3.5 shrink-0 animate-spin rounded-full border-2 border-ink-faint border-t-transparent motion-reduce:animate-none" />
  );

  return (
    <section className="bg-canvas px-5 py-14 font-sans text-ink md:px-[70px]">
      <div className="mx-auto max-w-[1300px]">
        <Reveal from="up">
          <h2 className="text-h2 text-ink">{heading}</h2>
          <p className="max-w-md text-h2 text-ink-muted">{subheading}</p>
        </Reveal>
        <Stagger step={110} className="mt-12 grid gap-3 md:grid-cols-3">
          {features.map((f, i) => (
            <article
              key={f.title}
              onMouseEnter={() => setHover(i)}
              onMouseLeave={() => setHover(null)}
              className="flex flex-col rounded-xs border border-hairline bg-surface p-[17px]"
            >
              <h3 className="text-body text-ink">{f.title}</h3>
              <p className="mt-1 min-h-[48px] text-body text-ink-muted">{f.description}</p>
              <a href={f.href} className="mt-5 inline-block self-start text-body text-accent underline-offset-4 hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent">
                {f.linkLabel} →
              </a>
              <div
                className={`relative mt-6 aspect-square overflow-hidden rounded-xs ${
                  i === 0 ? "bg-media-stone" : i === 1 ? "bg-media-sage" : "bg-surface-sunken"
                }`}
              >
                {i === 0 && (
                  <div className="absolute inset-x-[10%] top-[19%]">
                    <p className="mb-2 text-caption text-ink-muted">Started 4 subagents ⌄</p>
                    <div className="space-y-2">
                      {tasks.map((k, j) => (
                        <div
                          key={k.t}
                          style={{ animationDelay: `${j * 140}ms` }}
                          className={`flex animate-rise-in items-center gap-3 rounded-md border border-hairline bg-surface px-3 py-2 transition-transform duration-spring-pop ease-spring-pop ${k.on ? "" : "opacity-70"} ${hover === i ? "scale-[1.01]" : ""}`}
                        >
                          {k.on ? <Spinner /> : <span className="h-3.5 w-3.5 rounded-full border border-hairline" />}
                          <div className="min-w-0">
                            <p className="truncate text-ui text-ink">{k.t}</p>
                            <p className="truncate text-product-micro text-ink-muted">{k.m}</p>
                          </div>
                        </div>
                      ))}
                    </div>
                  </div>
                )}
                {i === 1 && (
                  <div className="absolute bottom-0 left-[7%] right-0 top-[7%] overflow-hidden rounded-tl-md bg-surface shadow-window">
                    <div className="flex gap-1.5 bg-surface-sunken px-3 py-2">
                      {[0, 1, 2].map((d) => (
                        <span key={d} className="h-2.5 w-2.5 rounded-full bg-hairline" />
                      ))}
                    </div>
                    <pre className="whitespace-pre-wrap p-4 font-mono text-[11px] leading-5 text-ink-muted">{`---\ndescription: Calm layout primitives\nglobs: src/ui/**/*\n---\n\n# Layout System\n\n## Patterns\n- Use Stack for vertical flow\n- Keyboard focus moves by row\n- Animations use 120ms ease-out\n- Spacing follows 4px grid\n- Palette opens with /`}</pre>
                    <div className="pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-surface to-transparent" />
                  </div>
                )}
                {i === 2 && (
                  <div className="absolute inset-x-[9%] top-[24%]">
                    <div className="animate-fade-in rounded-md border border-hairline bg-surface-deep px-3 py-2 text-ui text-ink">
                      Where does the reminder email get queued after a failure?
                    </div>
                    <ul className="mt-5 space-y-3 px-1">
                      {steps.map(([a, b], j) => (
                        <li key={b} style={{ animationDelay: `${j * 140}ms` }} className="animate-rise-in text-ui text-ink-muted">
                          <span className="text-ink">{a}</span> <span className="text-ink-faint">{b}</span>
                        </li>
                      ))}
                    </ul>
                  </div>
                )}
              </div>
            </article>
          ))}
        </Stagger>
      </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
—

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

Customer Story Logo Cards

Cards

Hairline Chevron Accordion

FAQ