Page sections / Feature sections
Soft Gradient Icon Benefit Trio
Three-column text blocks, each topped by a 48px pastel blue-lilac disc icon with pink accent slice, a medium 24px heading and gray body paragraph. Narrow centered container.
Rebuilt from vercel.com/solutions/turborepo in the Monochrome Precision style.
npx shadcn@latest add https://justyoink.it/r/monochrome-precision/blocks/gradient-icon-trio.json
Looks exactly like vercel.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/monochrome-precision/mine/gradient-icon-trio.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
Pass an `items` array of {title, body, icon: 'gauge' | 'pie' | 'ring'} to customize the three columns; renders standalone with defaults. Columns fade up in sequence on scroll.
components/gradient-icon-trio.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Item = { title: string; body: string; icon: "gauge" | "pie" | "ring" }; const DEFAULT_ITEMS: Item[] = [ { title: "Ship faster with less friction", body: "Quick pipelines and a simple setup your team will enjoy, folded into one automated flow from commit to release.", icon: "gauge" }, { title: "Run only what changed", body: "When connected to Northwind Cloud, only the affected packages are rebuilt, saving time and keeping everyone moving.", icon: "pie" }, { title: "Made for large codebases", body: "Designed by the people who maintain the tooling, to streamline your whole workspace without extra overhead.", icon: "ring" }, ]; function Icon({ type }: { type: Item["icon"] }) { return ( <svg width="48" height="48" viewBox="0 0 48 48" aria-hidden="true" className="block"> <defs> <linearGradient id={`g-${type}`} x1="0" y1="0" x2="1" y2="1"> <stop offset="0" stopColor="var(--color-aurora-blue)" /> <stop offset="1" stopColor="var(--color-aurora-pink)" /> </linearGradient> </defs> <circle cx="24" cy="24" r="22" fill={`url(#g-${type})`} /> {type === "gauge" && ( <path d="M16 36 L36 12" stroke="var(--color-accent-magenta)" strokeWidth="5" strokeLinecap="round" /> )} {type === "pie" && ( <path d="M24 24 L24 2 A22 22 0 0 1 46 24 Z" fill="var(--color-accent-magenta)" /> )} {type === "ring" && ( <> <circle cx="24" cy="24" r="21" fill="none" stroke="var(--color-accent-magenta)" strokeWidth="3" strokeDasharray="10 5" /> <circle cx="24" cy="24" r="5" fill="var(--color-canvas)" /> </> )} </svg> ); } export default function SoftGradientIconBenefitTrio({ items = DEFAULT_ITEMS }: { items?: Item[] }) { return ( <section className="bg-canvas py-16 md:py-24"> <div className="mx-auto max-w-[1064px] px-6"> <Stagger step={110} from="up" distance={20} className="grid gap-12 md:grid-cols-3 md:gap-14"> {items.map((it) => ( <div key={it.title} className="flex flex-col"> <Icon type={it.icon} /> <h3 className="mt-8 max-w-[220px] font-sans text-[24px] font-medium leading-8 tracking-[-0.02em] text-ink">{it.title}</h3> <p className="mt-4 font-sans text-[16px] leading-6 text-secondary">{it.body}</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; body: string; icon: "gauge" | "pie" | "ring" }; const DEFAULT_ITEMS: Item[] = [ { title: "Ship faster with less friction", body: "Quick pipelines and a simple setup your team will enjoy, folded into one automated flow from commit to release.", icon: "gauge" }, { title: "Run only what changed", body: "When connected to Northwind Cloud, only the affected packages are rebuilt, saving time and keeping everyone moving.", icon: "pie" }, { title: "Made for large codebases", body: "Designed by the people who maintain the tooling, to streamline your whole workspace without extra overhead.", icon: "ring" }, ]; function Icon({ type }: { type: Item["icon"] }) { return ( <svg width="48" height="48" viewBox="0 0 48 48" aria-hidden="true" className="block"> <defs> <linearGradient id={`g-${type}`} x1="0" y1="0" x2="1" y2="1"> <stop offset="0" stopColor="var(--color-muted-foreground)" /> <stop offset="1" stopColor="var(--color-muted-foreground)" /> </linearGradient> </defs> <circle cx="24" cy="24" r="22" fill={`url(#g-${type})`} /> {type === "gauge" && ( <path d="M16 36 L36 12" stroke="var(--color-monochrome-accent-magenta)" strokeWidth="5" strokeLinecap="round" /> )} {type === "pie" && ( <path d="M24 24 L24 2 A22 22 0 0 1 46 24 Z" fill="var(--color-monochrome-accent-magenta)" /> )} {type === "ring" && ( <> <circle cx="24" cy="24" r="21" fill="none" stroke="var(--color-monochrome-accent-magenta)" strokeWidth="3" strokeDasharray="10 5" /> <circle cx="24" cy="24" r="5" fill="var(--color-background)" /> </> )} </svg> ); } export default function SoftGradientIconBenefitTrio({ items = DEFAULT_ITEMS }: { items?: Item[] }) { return ( <section className="bg-background py-16 md:py-24"> <div className="mx-auto max-w-[1064px] px-6"> <Stagger step={110} from="up" distance={20} className="grid gap-12 md:grid-cols-3 md:gap-14"> {items.map((it) => ( <div key={it.title} className="flex flex-col"> <Icon type={it.icon} /> <h3 className="mt-8 max-w-[220px] font-sans text-[24px] font-medium leading-8 tracking-[-0.02em] text-foreground">{it.title}</h3> <p className="mt-4 font-sans text-[16px] leading-6 text-muted-foreground">{it.body}</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 · 4d 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.