Page sections / Logo clouds

Greyscale Logo Cloud Grid

Small caption above a bordered 6×2 grid of flat grey logos separated by vertical hairlines, quiet and low contrast.

Rebuilt from supabase.com in the Emerald Paper Precision style.

npx shadcn@latest add https://justyoink.it/r/emerald-paper-precision/blocks/greyscale-logo-grid.json

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

Usage

Props: `caption` text, `sets` (arrays of 12 {name, kind} logos; kind 0–5 picks a geometric mark) and `interval` in ms between swaps. Logos blur and rise out in a 100ms stagger per column, then the next set appears.

components/greyscale-logo-grid.tsx
"use client";

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

type Logo = { name: string; kind: number };

const SETS: Logo[][] = [
  [
    { name: "Northwind", kind: 0 }, { name: "Altura", kind: 1 }, { name: "Lumen", kind: 2 },
    { name: "Kitefield", kind: 3 }, { name: "Orbital", kind: 4 }, { name: "Pinecone", kind: 5 },
    { name: "Harbor", kind: 1 }, { name: "Quarry", kind: 0 }, { name: "Mosaic", kind: 3 },
    { name: "Tidewater", kind: 2 }, { name: "Fernhill", kind: 5 }, { name: "Copperline", kind: 4 },
  ],
  [
    { name: "Meridian", kind: 2 }, { name: "Basalt", kind: 0 }, { name: "Cobalt", kind: 4 },
    { name: "Juniper", kind: 1 }, { name: "Saffron", kind: 5 }, { name: "Driftwood", kind: 3 },
    { name: "Alder", kind: 3 }, { name: "Summit", kind: 2 }, { name: "Vellum", kind: 0 },
    { name: "Starling", kind: 4 }, { name: "Granite", kind: 1 }, { name: "Ember", kind: 5 },
  ],
];

function Mark({ kind }: { kind: number }) {
  const c = "h-6 w-6 shrink-0 fill-current";
  switch (kind) {
    case 0: return <svg viewBox="0 0 24 24" className={c} aria-hidden="true"><rect x="2" y="2" width="20" height="20" rx="6" /></svg>;
    case 1: return <svg viewBox="0 0 24 24" className={c} aria-hidden="true"><circle cx="12" cy="12" r="10" /></svg>;
    case 2: return <svg viewBox="0 0 24 24" className={c} aria-hidden="true"><path d="M12 2 22 21H2z" /></svg>;
    case 3: return <svg viewBox="0 0 24 24" className={c} aria-hidden="true"><path d="M2 2h12a8 8 0 0 1 0 16H2zM2 18h10v4H2z" /></svg>;
    case 4: return <svg viewBox="0 0 24 24" className={c} aria-hidden="true"><path d="M12 1 23 12 12 23 1 12z" /></svg>;
    default: return <svg viewBox="0 0 24 24" className={c} aria-hidden="true"><path d="M2 12a10 10 0 0 1 20 0v10H2z" /></svg>;
  }
}

export default function GreyscaleLogoCloudGrid({
  caption = "Relied on by teams building in the open",
  sets = SETS,
  interval = 4500,
}: { caption?: string; sets?: Logo[][]; interval?: number }) {
  const [idx, setIdx] = useState(0);
  const [out, setOut] = useState(false);

  useEffect(() => {
    if (sets.length < 2) return;
    let t2: ReturnType<typeof setTimeout>;
    const t = setInterval(() => {
      setOut(true);
      t2 = setTimeout(() => {
        setIdx((i) => (i + 1) % sets.length);
        setOut(false);
      }, 1300);
    }, interval);
    return () => { clearInterval(t); clearTimeout(t2); };
  }, [sets.length, interval]);

  const logos = sets[idx];

  return (
    <section className="w-full bg-canvas font-sans text-ink">
      <div className="mx-auto max-w-[1120px] px-6 pt-8 pb-6">
        <p className="text-label text-ink-muted">{caption}</p>
      </div>
      <div className="border-t border-hairline">
        <div className="mx-auto max-w-[1280px] border-x border-b border-hairline">
          <ul className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6">
            {logos.map((l, i) => (
              <li
                key={idx + l.name}
                className={"flex h-[100px] items-center justify-center border-hairline text-ink-faint lg:border-l lg:first:border-l-0 " + (i % 6 === 0 ? "lg:border-l-0" : "")}
              >
                <span
                  className="flex items-center gap-2 transition-all duration-[600ms] ease-out motion-reduce:transition-none"
                  style={{
                    transitionDelay: out ? (i % 6) * 100 + "ms" : "0ms",
                    opacity: out ? 0 : 1,
                    transform: out ? "translateY(-16px)" : "translateY(0)",
                    filter: out ? "blur(4px)" : "blur(0)",
                  }}
                >
                  <Mark kind={l.kind} />
                  <span className="font-display text-lead font-semibold tracking-tight">{l.name}</span>
                </span>
              </li>
            ))}
          </ul>
        </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 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