Cards & content / Lists

Dated Blog Index Table

Surface-tinted panel containing hairline-separated rows in columns: muted date · category, ink title, muted author, right-aligned reading time. Ends with a full-width sunken 'View more ↓' bar. Above: text filter tabs with active in ink and a pill search field.

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

npx shadcn@latest add https://justyoink.it/r/warm-paper-editorial/blocks/blog-index-table.json

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

Usage

Props: posts (date, category, title, author, time), tabs (first is the 'all' tab), moreLabel. Tabs filter by category and the search pill filters by title; renders standalone with defaults.

components/blog-index-table.tsx
"use client";

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

type Post = { date: string; category: string; title: string; author: string; time: string };

const defaultPosts: Post[] = [
  { date: "Nov 13, 2026", category: "Company", title: "A look back at our quarterly service outage", author: "Northwind Team", time: "6m" },
  { date: "Nov 10, 2026", category: "Product", title: "Shared canvases now support live editing", author: "Mara Ellison", time: "4m" },
  { date: "Oct 29, 2026", category: "Company", title: "Advisory: tampered release of a popular plugin (v3.2.1 and v3.2.2) found in the public extension registry", author: "Northwind Team", time: "5m" },
  { date: "Oct 20, 2026", category: "Product", title: "Introducing the Workflow toolkit", author: "Teo Hartwell", time: "5m" },
  { date: "Sep 23, 2026", category: "Research", title: "Faster indexing for very large repositories", author: "Ines, Colm & Paro", time: "7m" },
  { date: "Sep 10, 2026", category: "Product", title: "Introducing Spaces", author: "Lena & Oskar", time: "5m" },
  { date: "Aug 18, 2026", category: "Research", title: "Versioning at any scale", author: "Daniel Rowe", time: "27m" },
  { date: "Aug 13, 2026", category: "Company", title: "Kitefield joins Northwind", author: "Priya Anand", time: "2m" },
];

const defaultTabs = ["All", "Product", "Research", "Company", "Ideas", "Customers"];

export default function DatedBlogIndexTable({ posts = defaultPosts, tabs = defaultTabs, moreLabel = "View more ↓" }: { posts?: Post[]; tabs?: string[]; moreLabel?: string }) {
  const [active, setActive] = useState(tabs[0]);
  const [q, setQ] = useState("");
  const filtered = posts.filter(
    (p) => (active === tabs[0] || p.category === active) && p.title.toLowerCase().includes(q.toLowerCase())
  );
  return (
    <section className="bg-canvas font-sans text-ink px-4 py-6 sm:px-[70px]">
      <div className="mx-auto max-w-[1300px]">
        <div className="mb-6 flex flex-wrap items-center justify-between gap-3">
          <nav aria-label="Filter posts" className="flex flex-wrap gap-5">
            {tabs.map((t) => (
              <button
                key={t}
                onClick={() => setActive(t)}
                aria-pressed={active === t}
                className={`text-ui transition-colors duration-hover-color ease-hover-color focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink ${active === t ? "text-ink" : "text-ink-faint hover:text-ink"}`}
              >
                {t}
              </button>
            ))}
          </nav>
          <label className="flex w-full items-center gap-2 rounded-pill border border-hairline bg-surface px-3 py-1.5 sm:w-[192px]">
            <svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" className="text-ink-faint" aria-hidden="true">
              <circle cx="7" cy="7" r="4.5" />
              <path d="M10.5 10.5 14 14" strokeLinecap="round" />
            </svg>
            <input
              value={q}
              onChange={(e) => setQ(e.target.value)}
              placeholder="Search"
              aria-label="Search posts"
              className="w-full bg-transparent text-ui text-ink placeholder:text-ink-faint focus:outline-none"
            />
          </label>
        </div>
        <div className="rounded-xs border border-hairline bg-surface p-[17px]">
          <Stagger step={50} from="up" distance={10} className="flex flex-col">
            {filtered.map((p, i) => (
              <div
                key={p.title}
                className={`grid grid-cols-[1fr_auto] gap-x-4 gap-y-1 py-3.5 transition-colors duration-hover-color ease-hover-color hover:bg-surface-sunken md:grid-cols-[265px_1fr_240px_60px] ${i < filtered.length - 1 ? "border-b border-hairline" : "border-b border-hairline"}`}
              >
                <span className="order-2 col-span-2 text-ui text-ink-faint md:order-none md:col-span-1">{p.date} · {p.category}</span>
                <span className="order-1 text-ui text-ink md:order-none">{p.title}</span>
                <span className="order-3 text-ui text-ink-faint md:order-none">{p.author}</span>
                <span className="order-1 text-right text-ui text-ink-faint md:order-none">{p.time}</span>
              </div>
            ))}
            {filtered.length === 0 && <p className="py-6 text-ui text-ink-faint">No posts found.</p>}
          </Stagger>
          <button className="mt-[17px] w-full rounded-xs bg-surface-sunken py-4 text-ui text-ink transition-colors duration-hover-color ease-hover-color hover:bg-surface-deep focus-visible:outline focus-visible:outline-2 focus-visible:outline-ink">
            {moreLabel}
          </button>
        </div>
      </div>
    </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

Customer Story Logo Cards

Cards

Hairline Chevron Accordion

FAQ

Centered Pull Quote

Text effects