Page sections / Feature sections
Audience Icon Grid
4×2 grid inside a single hairline-bordered rounded container; each cell has a small outline icon, white role title and two-line grey blurb (Designers, Marketers, Site teams, Growth, Builders, Engineers, Agencies, Founders).
Rebuilt from framer.com/solutions/designers in the Obsidian Canvas style.
Looks exactly like framer.com: brings its fonts and colours, namespaced so your own theme stays untouched.
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 `heading` (use \n for a line break) and `items` (array of {icon, title, blurb}; icon is one of pen, bars, users, drop, cube, play, layout, user). Renders standalone with defaults.
components/audience-grid.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Item = { title: string; blurb: string; icon: string }; const defaultItems: Item[] = [ { icon: "pen", title: "Writers", blurb: "Draft, edit and polish long\nform stories with smart tools" }, { icon: "bars", title: "Analysts", blurb: "Track reports, trends and\nkey metrics in one place" }, { icon: "users", title: "Support teams", blurb: "Answer every customer thread\nfrom a single shared inbox" }, { icon: "drop", title: "Sales", blurb: "Grow your pipeline with\nautomated outreach and notes" }, { icon: "cube", title: "Makers", blurb: "Prototype products with\nlive data and custom scripts" }, { icon: "play", title: "Developers", blurb: "Ship features faster\nwithout piling up tickets" }, { icon: "layout", title: "Studios", blurb: "Deliver client projects quickly\nwithout losing quality" }, { icon: "user", title: "Operators", blurb: "Run your company day to day\nand keep momentum as you grow" }, ]; function Icon({ name }: { name: string }) { const p = { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", strokeWidth: 1.3, strokeLinecap: "round" as const, strokeLinejoin: "round" as const, "aria-hidden": true }; switch (name) { case "pen": return <svg {...p}><path d="M11 3l4 4-8 8H3v-4z" /><path d="M2 17h14" /></svg>; case "bars": return <svg {...p}><path d="M3 15V8M9 15V3M15 15V6" /></svg>; case "users": return <svg {...p}><circle cx="6.5" cy="6" r="2.5" /><circle cx="13" cy="7" r="2" /><path d="M2 15c0-2.5 2-4 4.5-4S11 12.500 11 15M12 11c2.500 0 4 1.500 4 4" /></svg>; case "drop": return <svg {...p}><path d="M9 2c3 4 5 6 5 8.500a5 5 0 01-10 0C4 8 6 6 9 2z" /></svg>; case "cube": return <svg {...p}><path d="M9 2l6 3v8l-6 3-6-3V5z" /><path d="M3 5l6 3 6-3M9 8v8" /></svg>; case "play": return <svg {...p}><rect x="2.500" y="2.500" width="13" height="13" rx="3" /><path d="M7.500 6.500l3 2.500-3 2.500z" /></svg>; case "layout": return <svg {...p}><rect x="2.500" y="2.500" width="13" height="13" rx="2" /><path d="M8 2.500v13M8 9h7.500" /></svg>; default: return <svg {...p}><circle cx="9" cy="6" r="3" /><path d="M3.500 16c0-3 2.500-5 5.500-5s5.500 2 5.500 5" /></svg>; } } export default function AudienceIconGrid({ heading = "Made for everyone\nwho builds products", items = defaultItems, }: { heading?: string; items?: Item[]; }) { return ( <section className="bg-canvas px-5 py-16 md:px-[120px] md:py-28"> <div className="mx-auto max-w-[1200px]"> <h2 className="font-display text-h2 whitespace-pre-line text-primary tracking-[-0.03em] text-4xl md:text-5xl leading-[1.05]"> {heading} </h2> <Stagger step={60} from="up" distance={12} className="mt-12 grid grid-cols-1 overflow-hidden rounded-xl border border-hairline sm:grid-cols-2 lg:grid-cols-4" > {items.map((it, i) => ( <div key={it.title} className="-mb-px -mr-px border-b border-r border-hairline bg-canvas p-5 transition-colors duration-surface-hover ease-surface-hover hover:bg-surface-raised" > <div className="text-primary"><Icon name={it.icon} /></div> <h3 className="mt-8 text-ui text-primary text-[15px]">{it.title}</h3> <p className="mt-0.5 whitespace-pre-line text-[15px] leading-[1.35] text-muted">{it.blurb}</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; blurb: string; icon: string }; const defaultItems: Item[] = [ { icon: "pen", title: "Writers", blurb: "Draft, edit and polish long\nform stories with smart tools" }, { icon: "bars", title: "Analysts", blurb: "Track reports, trends and\nkey metrics in one place" }, { icon: "users", title: "Support teams", blurb: "Answer every customer thread\nfrom a single shared inbox" }, { icon: "drop", title: "Sales", blurb: "Grow your pipeline with\nautomated outreach and notes" }, { icon: "cube", title: "Makers", blurb: "Prototype products with\nlive data and custom scripts" }, { icon: "play", title: "Developers", blurb: "Ship features faster\nwithout piling up tickets" }, { icon: "layout", title: "Studios", blurb: "Deliver client projects quickly\nwithout losing quality" }, { icon: "user", title: "Operators", blurb: "Run your company day to day\nand keep momentum as you grow" }, ]; function Icon({ name }: { name: string }) { const p = { width: 18, height: 18, viewBox: "0 0 18 18", fill: "none", stroke: "currentColor", strokeWidth: 1.3, strokeLinecap: "round" as const, strokeLinejoin: "round" as const, "aria-hidden": true }; switch (name) { case "pen": return <svg {...p}><path d="M11 3l4 4-8 8H3v-4z" /><path d="M2 17h14" /></svg>; case "bars": return <svg {...p}><path d="M3 15V8M9 15V3M15 15V6" /></svg>; case "users": return <svg {...p}><circle cx="6.5" cy="6" r="2.5" /><circle cx="13" cy="7" r="2" /><path d="M2 15c0-2.5 2-4 4.5-4S11 12.500 11 15M12 11c2.500 0 4 1.500 4 4" /></svg>; case "drop": return <svg {...p}><path d="M9 2c3 4 5 6 5 8.500a5 5 0 01-10 0C4 8 6 6 9 2z" /></svg>; case "cube": return <svg {...p}><path d="M9 2l6 3v8l-6 3-6-3V5z" /><path d="M3 5l6 3 6-3M9 8v8" /></svg>; case "play": return <svg {...p}><rect x="2.500" y="2.500" width="13" height="13" rx="3" /><path d="M7.500 6.500l3 2.500-3 2.500z" /></svg>; case "layout": return <svg {...p}><rect x="2.500" y="2.500" width="13" height="13" rx="2" /><path d="M8 2.500v13M8 9h7.500" /></svg>; default: return <svg {...p}><circle cx="9" cy="6" r="3" /><path d="M3.500 16c0-3 2.500-5 5.500-5s5.500 2 5.500 5" /></svg>; } } export default function AudienceIconGrid({ heading = "Made for everyone\nwho builds products", items = defaultItems, }: { heading?: string; items?: Item[]; }) { return ( <section className="bg-background px-5 py-16 md:px-[120px] md:py-28"> <div className="mx-auto max-w-[1200px]"> <h2 className="font-sans text-obsidian-h2 whitespace-pre-line text-foreground tracking-[-0.03em] text-4xl md:text-5xl leading-[1.05]"> {heading} </h2> <Stagger step={60} from="up" distance={12} className="mt-12 grid grid-cols-1 overflow-hidden rounded-2xl border border-border sm:grid-cols-2 lg:grid-cols-4" > {items.map((it, i) => ( <div key={it.title} className="-mb-px -mr-px border-b border-r border-border bg-background p-5 transition-colors duration-obsidian-surface-hover ease-obsidian-surface-hover hover:bg-secondary" > <div className="text-foreground"><Icon name={it.icon} /></div> <h3 className="mt-8 text-obsidian-ui text-foreground text-[15px]">{it.title}</h3> <p className="mt-0.5 whitespace-pre-line text-[15px] leading-[1.35] text-muted-foreground">{it.blurb}</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.