Page sections / Feature sections

Platform Capability Bento

Mixed-width white bento cards with greyed icon titles and bottom-anchored copy where the lead sentence is dark and the rest is muted; includes a chip grid of services (Database, Storage, Auth…) and one dark inset panel with dashed green outline and an orange 'Shared Infrastructure' tag.

Rebuilt from supabase.com/solutions/ai-builders in the Emerald Paper Precision style.

npx shadcn@latest add https://justyoink.it/r/emerald-paper-precision/blocks/platform-bento-cards.json

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

Usage

Props: heading, intro, chips (string[]), mainTitle/mainLead/mainRest for the first card, cards (6 items of title, lead, rest) and tag for the dark panel. Renders standalone with defaults.

components/platform-bento-cards.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Card = { title: string; lead: string; rest: string };

type Props = {
  heading?: string;
  intro?: string;
  chips?: string[];
  mainTitle?: string;
  mainLead?: string;
  mainRest?: string;
  cards?: Card[];
  tag?: string;
};

const Icon = () => (
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.2" aria-hidden="true">
    <rect x="2.5" y="2.5" width="11" height="11" rx="3" />
    <circle cx="8" cy="8" r="2" />
  </svg>
);

function Title({ children }: { children: string }) {
  return (
    <h3 className="flex items-center gap-2 text-lead font-medium text-ink-muted">
      <Icon />
      {children}
    </h3>
  );
}

function Copy({ lead, rest }: { lead: string; rest: string }) {
  return (
    <p className="text-body text-ink-muted">
      <span className="text-ink">{lead} </span>
      {rest}
    </p>
  );
}

const shell = "flex flex-col justify-between gap-10 rounded-xl border border-hairline bg-surface p-6";

export default function PlatformCapabilityBento({
  heading = "Toolkit for Marketplaces",
  intro = "Give every seller a polished storefront experience, powered by a dependable hosted engine behind the scenes.",
  chips = ["Catalog", "Orders", "Payouts", "Search", "Webhooks", "Reports"],
  mainTitle = "One stack, tuned for commerce",
  mainLead = "Start with a solid foundation that stretches as sellers do.",
  mainRest = "Every building block you need to launch a shop is included, so merchants can open quickly and grow into thousands of orders without a rewrite.",
  cards = [
    { title: "Fulfilment API", lead: "Automate shipping for every merchant.", rest: "Create labels and track parcels programmatically, with sensible defaults on every account." },
    { title: "Fees", lead: "Simple rates made for small shops.", rest: "Flexible plans let sellers start free and add capacity once sales pick up steadily." },
    { title: "Staging", lead: "Try storefront edits safely.", rest: "Preview layout and price changes in an isolated copy before they reach live shoppers." },
    { title: "Handover", lead: "Sellers can take full control of their store", rest: "through a short approval step, with your platform retaining limited rights." },
    { title: "Widget Library", lead: "Drop-in panels for the Fulfilment API", rest: "that you embed in your dashboard so sellers never need to leave your product." },
    { title: "Micro tiers", lead: "Pause idle shops to cut costs and stay lean.", rest: "Offered to selected partners only." },
  ],
  tag = "Pooled Capacity",
}: Props) {
  return (
    <section className="bg-canvas px-6 py-20 font-sans text-ink">
      <div className="mx-auto max-w-[1088px]">
        <Reveal>
          <h2 className="font-display text-h1 tracking-[-0.02em]">{heading}</h2>
          <p className="mt-3 max-w-[27rem] text-lead text-ink-muted">{intro}</p>
        </Reveal>
        <Stagger className="mt-10 grid gap-5 md:grid-cols-6" step={80}>
          <div className={`${shell} md:col-span-2`}>
            <div className="grid grid-cols-2 gap-x-4 gap-y-3 bg-card-wash p-2">
              {chips.map((c) => (
                <div key={c} className="flex items-center gap-2 text-caption text-ink-soft">
                  <span className="flex h-[30px] w-[30px] items-center justify-center rounded-md border border-hairline bg-surface text-ink-muted">
                    <Icon />
                  </span>
                  {c}
                </div>
              ))}
            </div>
            <div>
              <h3 className="mb-3 flex items-start gap-3 text-lead font-medium text-ink-muted">
                <span className="mt-1"><Icon /></span>
                {mainTitle}
              </h3>
              <Copy lead={mainLead} rest={mainRest} />
            </div>
          </div>
          <div className={`${shell} min-h-[260px] md:col-span-4`}>
            <Title>{cards[0].title}</Title>
            <Copy lead={cards[0].lead} rest={cards[0].rest} />
          </div>
          {[1, 2, 3].map((i) => (
            <div key={i} className={`${shell} min-h-[250px] md:col-span-2`}>
              <Title>{cards[i].title}</Title>
              <Copy lead={cards[i].lead} rest={cards[i].rest} />
            </div>
          ))}
          <div className={`${shell} min-h-[250px] md:col-span-2`}>
            <Title>{cards[4].title}</Title>
            <Copy lead={cards[4].lead} rest={cards[4].rest} />
          </div>
          <div className="flex flex-col gap-6 rounded-xl border border-hairline bg-surface p-6 sm:flex-row md:col-span-4">
            <div className="flex flex-1 flex-col justify-between gap-10">
              <Title>{cards[5].title}</Title>
              <Copy lead={cards[5].lead} rest={cards[5].rest} />
            </div>
            <div className="flex flex-1 flex-col items-center justify-center gap-5 rounded-md bg-night p-6">
              <div className="flex w-full items-center justify-between rounded-md border border-dashed border-brand-bright/60 p-5">
                {[0, 1, 2].map((n) => (
                  <div key={n} className="flex flex-col gap-1">
                    <span className="h-3 w-9 rounded-xs border border-surface" />
                    <span className="h-3 w-9 rounded-xs border border-surface" />
                  </div>
                ))}
              </div>
              <span className="rounded-pill border border-amber-code/60 bg-amber-code/10 px-2 py-0.5 font-mono text-[9px] text-amber-code">{tag}</span>
            </div>
          </div>
        </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 Emerald Paper Precision

The whole style →

Hairline Site Header

Headers & nav bars

Framework Icon Tab Code Panel

Code blocks

Gradient Customer Story Strip

Testimonials

Compute Pricing Calculator

Forms

Two-Tone Split Hero

Heroes

Hairline Bento Product Grid

Feature sections