Hairline Three-Column Pricing
Single bordered container split into three equal columns by hairlines: plan name with optional 'Popular' pill, giant price with mono '/mo.' suffix, muted description, divider, icon-led feature list, and a bottom-pinned CTA (outline for Hobby/Enterprise, solid ink for Pro). Tax footnote underneath in 12px text.
Rebuilt from vercel.com/pricing in the Monochrome Precision style.
Looks exactly like vercel.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 `plans` (name, badge, price, suffix, description, featuresLabel, features, cta, href, primary) plus `footnote`, `footnoteLinkLabel` and `footnoteLinkHref`; all have defaults so it renders with no props.
components/three-tier-pricing-grid.tsx
"use client"; import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react"; type Plan = { name: string; badge?: string; price: string; suffix?: string; description: string; featuresLabel?: string; features: string[]; cta: string; href: string; primary?: boolean; }; const defaultPlans: Plan[] = [ { name: "Starter", price: "$0", suffix: "/mo.", description: "A friendly place to begin shipping your first project.", features: [ "Connect a repository in minutes", "Automated build pipeline", "Basic request filtering", "Shared edge caching", "Serverless functions", "Abuse protection", "Usage and speed reports", ], cta: "Begin building", href: "#", }, { name: "Team", badge: "Popular", price: "$24", suffix: "/mo.", description: "All the tools to launch and grow a product with confidence.", featuresLabel: "Everything in Starter, plus:", features: [ "$24 monthly usage allowance", "Predictable edge bandwidth", "Budget alerts and limits", "Shared workspace with free reviewers", "Instant function warmup", "Custom domain included", ], cta: "Try it free", href: "#", primary: true, }, { name: "Scale", price: "Custom", description: "Advanced controls, uptime guarantees and dedicated help for large orgs.", featuresLabel: "Everything in Team, plus:", features: [ "Single sign-on and roles", "Directory provisioning", "Curated firewall policies", "Multi-region failover", "99.99% uptime commitment", "Priority support line", ], cta: "Book a call", href: "#", }, ]; function Dot() { return ( <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.4" aria-hidden="true" className="shrink-0 text-ink"> <rect x="2.5" y="2.5" width="11" height="11" rx="3" /> <path d="M5.5 8.2l1.8 1.8 3.2-3.6" strokeLinecap="round" strokeLinejoin="round" /> </svg> ); } export default function HairlineThreeColumnPricing({ plans = defaultPlans, footnote = "Listed amounts are in US dollars and do not include sales tax or similar duties. Any applicable charges are computed from your billing details and added to each invoice.", footnoteLinkLabel = "Read about tax handling", footnoteLinkHref = "#", }: { plans?: Plan[]; footnote?: string; footnoteLinkLabel?: string; footnoteLinkHref?: string; }) { return ( <section className="bg-canvas px-4 py-16 font-sans text-ink sm:px-6"> <div className="mx-auto max-w-[1392px]"> <Stagger step={90} from="up" distance={16} className="grid divide-y divide-hairline border border-hairline bg-surface md:grid-cols-3 md:divide-x md:divide-y-0"> {plans.map((p) => ( <article key={p.name} className="flex flex-col p-8"> <div className="flex h-6 items-center gap-3"> <h3 className="text-ui font-medium">{p.name}</h3> {p.badge && ( <span className="rounded-pill bg-surface-muted px-2 py-0.5 text-[11px] font-medium">{p.badge}</span> )} </div> <div className="mt-6 flex items-end gap-2"> <span className="text-[64px] font-medium leading-none tracking-[-0.04em]">{p.price}</span> {p.suffix && <span className="mb-2 font-mono text-ui text-secondary">{p.suffix}</span>} </div> <p className="mt-5 min-h-[48px] max-w-[300px] text-lead text-secondary">{p.description}</p> <hr className="mt-6 border-hairline" /> <div className="mt-6 flex-1"> {p.featuresLabel && <p className="mb-3 text-ui text-tertiary">{p.featuresLabel}</p>} <ul className="space-y-4 text-ui text-secondary"> {p.features.map((f) => ( <li key={f} className="flex items-center gap-3"> <Dot /> <span>{f}</span> </li> ))} </ul> </div> <div className="mt-8"> <a href={p.href} className={ p.primary ? "inline-flex h-9 items-center rounded-pill bg-ink px-4 text-ui font-medium text-surface outline-none transition-colors duration-hover-fill ease-hover-fill hover:bg-ink-hover focus-visible:ring-2 focus-visible:ring-link-blue" : "inline-flex h-9 items-center rounded-pill bg-surface px-4 text-ui font-medium text-ink shadow-ring outline-none transition-colors duration-hover-fill ease-hover-fill hover:bg-surface-muted focus-visible:ring-2 focus-visible:ring-link-blue" } > {p.cta} </a> </div> </article> ))} </Stagger> <p className="mx-auto mt-8 max-w-[740px] text-center text-caption text-secondary"> {footnote}{" "} <a href={footnoteLinkHref} className="border-b border-secondary text-ink focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-link-blue"> {footnoteLinkLabel} </a> . </p> </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 Plan = { name: string; badge?: string; price: string; suffix?: string; description: string; featuresLabel?: string; features: string[]; cta: string; href: string; primary?: boolean; }; const defaultPlans: Plan[] = [ { name: "Starter", price: "$0", suffix: "/mo.", description: "A friendly place to begin shipping your first project.", features: [ "Connect a repository in minutes", "Automated build pipeline", "Basic request filtering", "Shared edge caching", "Serverless functions", "Abuse protection", "Usage and speed reports", ], cta: "Begin building", href: "#", }, { name: "Team", badge: "Popular", price: "$24", suffix: "/mo.", description: "All the tools to launch and grow a product with confidence.", featuresLabel: "Everything in Starter, plus:", features: [ "$24 monthly usage allowance", "Predictable edge bandwidth", "Budget alerts and limits", "Shared workspace with free reviewers", "Instant function warmup", "Custom domain included", ], cta: "Try it free", href: "#", primary: true, }, { name: "Scale", price: "Custom", description: "Advanced controls, uptime guarantees and dedicated help for large orgs.", featuresLabel: "Everything in Team, plus:", features: [ "Single sign-on and roles", "Directory provisioning", "Curated firewall policies", "Multi-region failover", "99.99% uptime commitment", "Priority support line", ], cta: "Book a call", href: "#", }, ]; function Dot() { return ( <svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.4" aria-hidden="true" className="shrink-0 text-foreground"> <rect x="2.5" y="2.5" width="11" height="11" rx="3" /> <path d="M5.5 8.2l1.8 1.8 3.2-3.6" strokeLinecap="round" strokeLinejoin="round" /> </svg> ); } export default function HairlineThreeColumnPricing({ plans = defaultPlans, footnote = "Listed amounts are in US dollars and do not include sales tax or similar duties. Any applicable charges are computed from your billing details and added to each invoice.", footnoteLinkLabel = "Read about tax handling", footnoteLinkHref = "#", }: { plans?: Plan[]; footnote?: string; footnoteLinkLabel?: string; footnoteLinkHref?: string; }) { return ( <section className="bg-background px-4 py-16 font-sans text-foreground sm:px-6"> <div className="mx-auto max-w-[1392px]"> <Stagger step={90} from="up" distance={16} className="grid divide-y divide-border border border-border bg-card md:grid-cols-3 md:divide-x md:divide-y-0"> {plans.map((p) => ( <article key={p.name} className="flex flex-col p-8"> <div className="flex h-6 items-center gap-3"> <h3 className="text-monochrome-ui font-medium">{p.name}</h3> {p.badge && ( <span className="rounded-full bg-secondary px-2 py-0.5 text-[11px] font-medium">{p.badge}</span> )} </div> <div className="mt-6 flex items-end gap-2"> <span className="text-[64px] font-medium leading-none tracking-[-0.04em]">{p.price}</span> {p.suffix && <span className="mb-2 font-mono text-monochrome-ui text-muted-foreground">{p.suffix}</span>} </div> <p className="mt-5 min-h-[48px] max-w-[300px] text-monochrome-lead text-muted-foreground">{p.description}</p> <hr className="mt-6 border-border" /> <div className="mt-6 flex-1"> {p.featuresLabel && <p className="mb-3 text-monochrome-ui text-muted-foreground">{p.featuresLabel}</p>} <ul className="space-y-4 text-monochrome-ui text-muted-foreground"> {p.features.map((f) => ( <li key={f} className="flex items-center gap-3"> <Dot /> <span>{f}</span> </li> ))} </ul> </div> <div className="mt-8"> <a href={p.href} className={ p.primary ? "inline-flex h-9 items-center rounded-full bg-primary px-4 text-monochrome-ui font-medium text-card outline-none transition-colors duration-monochrome-hover-fill ease-monochrome-hover-fill hover:bg-primary focus-visible:ring-2 focus-visible:ring-primary" : "inline-flex h-9 items-center rounded-full bg-card px-4 text-monochrome-ui font-medium text-foreground shadow-monochrome-ring outline-none transition-colors duration-monochrome-hover-fill ease-monochrome-hover-fill hover:bg-secondary focus-visible:ring-2 focus-visible:ring-primary" } > {p.cta} </a> </div> </article> ))} </Stagger> <p className="mx-auto mt-8 max-w-[740px] text-center text-monochrome-caption text-muted-foreground"> {footnote}{" "} <a href={footnoteLinkHref} className="border-b border-muted-foreground text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"> {footnoteLinkLabel} </a> . </p> </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: not passedElements must meet minimum color contrast ratio thresholds (2 elements)
- 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.