Page sections / Feature sections
Hairline Use-Case Grid
Three-by-two grid separated only by 1px hairline dividers, each cell with a light-weight title and gray two-line description beneath a centered eyebrow and gradient heading.
Rebuilt from resend.com/products/inboxes in the Obsidian Serif Glow style.
npx shadcn@latest add https://yoink-app.fly.dev/r/obsidian-serif-glow/blocks/hairline-use-case-grid.json
Looks exactly like resend.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://yoink-app.fly.dev/r/obsidian-serif-glow/mine/hairline-use-case-grid.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: eyebrow, heading, subheading, and items (array of {title, description}). Renders standalone with defaults; cells fade in with an 80ms stagger on scroll.
components/hairline-use-case-grid.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Item = { title: string; description: string }; export default function HairlineUseCaseGrid({ eyebrow = "Adaptable", heading = "Fits every workflow", subheading = "From small teams to large platforms, shape the tool around how you work.", items = [ { title: "Pipelines", description: "Give every job its own queue to receive tasks, reviews, and status changes." }, { title: "Helpdesk", description: "Funnel customer messages into your app and read each conversation over the API." }, { title: "Scheduling", description: "Let your assistant triage invitations, propose times, and keep calendars tidy." }, { title: "Hiring", description: "Give teams one shared workspace to follow every applicant from start to finish." }, { title: "Incidents", description: "Gather alarms in one place and hand each one to an owner, leaving none orphaned." }, { title: "Alerts", description: "Deliver confirmations, warnings, and digests through one channel your app controls." }, ] as Item[], }) { return ( <section className="bg-background px-6 py-24 text-primary"> <div className="mx-auto max-w-[1024px]"> <div className="flex flex-col items-center text-center"> <div className="flex items-center gap-2 text-ui text-secondary"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round" aria-hidden="true"> <path d="M12 3l9 5-9 5-9-5 9-5z" /> <path d="M3 13l9 5 9-5" /> </svg> <span>{eyebrow}</span> </div> <h2 className="mt-6 max-w-[520px] bg-silver-text bg-clip-text font-display text-h1 text-transparent"> {heading} </h2> <p className="mt-5 max-w-[360px] text-lead text-secondary">{subheading}</p> </div> <Stagger step={80} from="fade" duration={300} className="mt-20 grid grid-cols-1 md:grid-cols-3"> {items.map((it, i) => ( <div key={it.title} className={[ "border-hairline p-10", i % 3 !== 0 ? "md:border-l" : "", i >= 3 ? "md:border-t" : "", i > 0 ? "max-md:border-t" : "", ].join(" ")} > <h3 className="text-lead font-light tracking-wide text-primary">{it.title}</h3> <p className="mt-4 max-w-[280px] text-ui text-secondary">{it.description}</p> </div> ))} </Stagger> </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> ); }"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Item = { title: string; description: string }; export default function HairlineUseCaseGrid({ eyebrow = "Adaptable", heading = "Fits every workflow", subheading = "From small teams to large platforms, shape the tool around how you work.", items = [ { title: "Pipelines", description: "Give every job its own queue to receive tasks, reviews, and status changes." }, { title: "Helpdesk", description: "Funnel customer messages into your app and read each conversation over the API." }, { title: "Scheduling", description: "Let your assistant triage invitations, propose times, and keep calendars tidy." }, { title: "Hiring", description: "Give teams one shared workspace to follow every applicant from start to finish." }, { title: "Incidents", description: "Gather alarms in one place and hand each one to an owner, leaving none orphaned." }, { title: "Alerts", description: "Deliver confirmations, warnings, and digests through one channel your app controls." }, ] as Item[], }) { return ( <section className="bg-background px-6 py-24 text-foreground"> <div className="mx-auto max-w-[1024px]"> <div className="flex flex-col items-center text-center"> <div className="flex items-center gap-2 text-obsidian-ui text-muted-foreground"> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinejoin="round" aria-hidden="true"> <path d="M12 3l9 5-9 5-9-5 9-5z" /> <path d="M3 13l9 5 9-5" /> </svg> <span>{eyebrow}</span> </div> <h2 className="mt-6 max-w-[520px] bg-clip-text font-sans text-obsidian-h1 text-transparent"> {heading} </h2> <p className="mt-5 max-w-[360px] text-obsidian-lead text-muted-foreground">{subheading}</p> </div> <Stagger step={80} from="fade" duration={300} className="mt-20 grid grid-cols-1 md:grid-cols-3"> {items.map((it, i) => ( <div key={it.title} className={[ "border-border p-10", i % 3 !== 0 ? "md:border-l" : "", i >= 3 ? "md:border-t" : "", i > 0 ? "max-md:border-t" : "", ].join(" ")} > <h3 className="text-obsidian-lead font-light tracking-wide text-foreground">{it.title}</h3> <p className="mt-4 max-w-[280px] text-obsidian-ui text-muted-foreground">{it.description}</p> </div> ))} </Stagger> </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 · 5d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: passedIts animation plays and finishes with everything visible, and it stays still for people who turn on reduced motion.