Blog Grid 1
Blog index built to earn the next click: a featured play overlapping a full-bleed photo, a topic filter that reflows a balanced card grid, and a letter-style newsletter strip set inside the grid.
Use it in a prompt
Use content/blog-grid from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/content/blog-grid.tsx. - Import it and pass your copy and images (Props tab):
import { BlogGrid } from "@/components/funneldna/content/blog-grid"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/blog-grid/component.tsx 543 lines
// layout: photo-overlap-card
// Blog index built to earn the next click: a featured play overlapping a full-bleed photo, a topic filter that reflows a balanced card grid, and a letter-style newsletter strip set inside the grid.
import * as React from "react"
import { AlertCircle, Clock, Loader2, Lock } from "lucide-react"
import { AnimatePresence, motion, useReducedMotion, type MotionProps } from "motion/react"
export type BlogPost = {
title: string
excerpt: string
category: string
/** Cover photo (slot item-n); a post without one renders as a text card. */
image?: string
imageAlt?: string
href?: string
author?: string
date?: string
readTime?: string
}
export type BlogGridNewsletter = {
heading: React.ReactNode
salutation: string
paragraphs: React.ReactNode[]
closing: string
signoff: string
role: string
label: string
placeholder: string
button: string
submittingLabel: string
/** Quiet line under the button, linking to the articles after the strip. */
secondaryLabel: string
/** Used instead when no articles follow the strip. */
secondaryLabelEnd: string
secondaryHref?: string
privacy: string
errorEmpty: string
errorInvalid: string
}
export type BlogGridCopy = {
filterLabel: string
allLabel: string
/** "{count}" becomes the number of visible articles. */
count: string
countOne: string
featuredFlag: string
featuredAction: string
/** "{author}" becomes the featured post's author. */
byline: string
}
export type BlogGridProps = {
headline?: React.ReactNode
lead?: React.ReactNode
/** Full-bleed photo the featured card overlaps (slot: scene). */
sceneImage?: string
sceneImageAlt?: string
featured?: BlogPost
posts?: BlogPost[]
/** Filter order; defaults to the categories in post order. */
categories?: string[]
newsletter?: Partial<BlogGridNewsletter>
showNewsletter?: boolean
/** How many articles sit before the newsletter strip. */
newsletterAt?: number
copy?: Partial<BlogGridCopy>
/** id of the article grid; the newsletter's quiet link points into it. */
anchorId?: string
/** Shows the loading label on the newsletter button. */
submitting?: boolean
onSubmit?: (values: { email: string }) => void
onAction?: (post: BlogPost) => void
state?: "default" | "hover" | "active" | "disabled" | "error"
className?: string
}
type CellSize = "third" | "half" | "wide"
type Cell = { kind: "post"; post: BlogPost; size: CellSize; id?: string } | { kind: "strip" }
const EASE: [number, number, number, number] = [0.2, 0.7, 0.2, 1]
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/
const DEFAULT_HEADLINE = "Plays that get your first funnel live"
const DEFAULT_LEAD = "Short, practical reads on planning, page copy and launch. Pick a topic, or start with the featured play below."
const DEFAULT_COPY: BlogGridCopy = {
filterLabel: "Filter articles by topic",
allLabel: "All articles",
count: "{count} articles",
countOne: "{count} article",
featuredFlag: "Featured play",
featuredAction: "Read the full play",
byline: "By {author}",
}
const DEFAULT_NEWSLETTER: BlogGridNewsletter = {
heading: "Get one practical funnel play every week",
salutation: "Dear friend,",
paragraphs: [
"Most first funnels stall before a single page goes live. Not because the idea is weak. Because the plan is missing.",
"So once a week we send one short play from this blog: a headline to try, a page to fix, a step to check before you launch.",
],
closing: "Talk soon,",
signoff: "The editors",
role: "",
label: "Your best email",
placeholder: "you@example.com",
button: "Send Me the Next Play",
submittingLabel: "Sending…",
secondaryLabel: "or keep browsing the articles below",
secondaryLabelEnd: "or browse the articles above",
privacy: "We respect your inbox. Unsubscribe anytime.",
errorEmpty: "Enter your email so we can send the next play.",
errorInvalid: "That email doesn't look right. Check it and try again.",
}
const DEFAULT_FEATURED: BlogPost = {
category: "Planning",
title: "Plan your first funnel in one evening, page by page",
excerpt: "Map the offer, the opt-in and the thank-you page before you write a word. Here is the order that keeps it simple.",
readTime: "8 min read",
}
const DEFAULT_POSTS: BlogPost[] = [
{ category: "Copy", title: "Write a headline that makes one specific promise", excerpt: "Swap the clever line for a clear one: who it is for, what they get, and how soon.", readTime: "6 min read" },
{ category: "Planning", title: "The three pages every starter funnel needs", excerpt: "An opt-in, a thank-you page and one offer. What goes on each, and what to leave off for now.", readTime: "5 min read" },
{ category: "Launch", title: "Check these nine things before you share your link", excerpt: "Broken forms and missing redirects cost the most on day one. Run this list in fifteen minutes.", readTime: "4 min read" },
{ category: "Copy", title: "Turn every bullet into a reason to keep reading", excerpt: "Name the benefit, hold back the how. Three rewrites, before and after.", readTime: "7 min read" },
{ category: "Offers", title: "Price your first offer without guessing", excerpt: "Start from what the buyer gets, not what others charge. A simple way to pick your first number.", readTime: "6 min read" },
]
export function BlogGrid(props: BlogGridProps) {
const {
headline = DEFAULT_HEADLINE,
lead = DEFAULT_LEAD,
sceneImage,
sceneImageAlt = "",
featured = DEFAULT_FEATURED,
posts = DEFAULT_POSTS,
categories,
showNewsletter = true,
newsletterAt = 3,
anchorId = "blog-articles",
submitting = false,
onSubmit,
onAction,
state = "default",
className,
} = props
const copy: BlogGridCopy = { ...DEFAULT_COPY, ...props.copy }
const nl: BlogGridNewsletter = { ...DEFAULT_NEWSLETTER, ...props.newsletter }
const reduce = useReducedMotion() ?? false
const uid = React.useId()
const [active, setActive] = React.useState<string | null>(null)
const [email, setEmail] = React.useState("")
const [error, setError] = React.useState<"empty" | "invalid" | null>(null)
const topics = React.useMemo(
() => (categories && categories.length > 0 ? categories : Array.from(new Set(posts.map((p) => p.category)))),
[categories, posts],
)
const counts = React.useMemo(() => {
const map: Record<string, number> = {}
for (const p of posts) map[p.category] = (map[p.category] ?? 0) + 1
return map
}, [posts])
const visible = active ? posts.filter((p) => p.category === active) : posts
const at = Math.max(0, Math.min(newsletterAt, visible.length))
const before = showNewsletter ? visible.slice(0, at) : visible
const after = showNewsletter ? visible.slice(at) : []
const moreId = `${anchorId}-more`
const disabled = state === "disabled"
const shownError = state === "error" ? error ?? "empty" : error
const fieldId = `${uid}-email`
const errorId = `${uid}-error`
const countText = fill(visible.length === 1 ? copy.countOne : copy.count, { count: String(visible.length) })
const featuredMeta = featured
? [featured.author ? fill(copy.byline, { author: featured.author }) : "", featured.date ?? ""].filter(Boolean).join(" · ")
: ""
const cells: Cell[] = [
...before.map((post, i): Cell => ({ kind: "post", post, size: sizeFor(i, before.length) })),
...(showNewsletter ? [{ kind: "strip" } as Cell] : []),
...after.map((post, i): Cell => ({ kind: "post", post, size: sizeFor(i, after.length), id: i === 0 ? moreId : undefined })),
]
const cellMotion: MotionProps = reduce
? { initial: false }
: {
layout: "position",
initial: { opacity: 0.82, y: 8 },
animate: { opacity: 1, y: 0 },
exit: { opacity: 0, scale: 0.97, transition: { duration: 0.18 } },
transition: { duration: 0.45, ease: EASE },
}
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (disabled || submitting) return
const value = email.trim()
if (!value) {
setError("empty")
return
}
if (!EMAIL.test(value)) {
setError("invalid")
return
}
setError(null)
onSubmit?.({ email: value })
}
function open(post: BlogPost) {
return (event: React.MouseEvent<HTMLAnchorElement>) => {
if (!post.href) event.preventDefault()
onAction?.(post)
}
}
function renderPost(post: BlogPost, size: CellSize, id?: string) {
return (
<motion.article key={`post-${post.category}-${post.title}`} id={id} className={`cf-blog-grid__cell is-${size}`} {...cellMotion}>
<div className={`cf-blog-grid__card${post.image ? "" : " is-text"}`}>
{post.image ? (
<div className="cf-blog-grid__media">
<img src={post.image} alt={post.imageAlt ?? ""} loading="lazy" decoding="async" />
</div>
) : null}
<div className="cf-blog-grid__body">
<span className="cf-blog-grid__chip">{post.category}</span>
<h3 className="cf-blog-grid__title">
<a href={post.href ?? "#"} onClick={open(post)}>
{post.title}
</a>
</h3>
<p className="cf-blog-grid__excerpt">{post.excerpt}</p>
{post.date || post.readTime ? (
<p className="cf-blog-grid__card-meta">
{post.date}
{post.date && post.readTime ? <span aria-hidden="true"> · </span> : null}
{post.readTime ? (
<>
<Clock className="cf-blog-grid__ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{post.readTime}
</>
) : null}
</p>
) : null}
</div>
</div>
</motion.article>
)
}
const buttonClass = `cf-blog-grid__btn${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-active" : ""}`
const strip = (
<motion.aside key="newsletter" className="cf-blog-grid__cell is-strip" aria-labelledby={`${uid}-nl`} {...cellMotion}>
<div className="cf-blog-grid__strip">
<div className="cf-blog-grid__letter">
<h3 id={`${uid}-nl`} className="cf-blog-grid__big">
{nl.heading}
</h3>
<p className="cf-blog-grid__salute">{nl.salutation}</p>
{nl.paragraphs.map((p, i) => (
<p key={i} className="cf-blog-grid__para">
{p}
</p>
))}
<p className="cf-blog-grid__closing">{nl.closing}</p>
<p className="cf-blog-grid__sign">
<span className="cf-blog-grid__sign-name">{nl.signoff}</span>
{nl.role ? <span className="cf-blog-grid__sign-role">{nl.role}</span> : null}
</p>
</div>
<form className="cf-blog-grid__form" noValidate onSubmit={handleSubmit}>
<label className="cf-blog-grid__label" htmlFor={fieldId}>
{nl.label}
</label>
<input
id={fieldId}
className="cf-blog-grid__field"
type="email"
name="email"
inputMode="email"
autoComplete="email"
placeholder={nl.placeholder}
value={email}
disabled={disabled}
aria-invalid={shownError ? true : undefined}
aria-describedby={shownError ? errorId : undefined}
onChange={(event) => {
setEmail(event.target.value)
if (error) setError(null)
}}
/>
{shownError ? (
<p id={errorId} className="cf-blog-grid__error" role="alert">
<AlertCircle className="cf-blog-grid__ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{shownError === "invalid" ? nl.errorInvalid : nl.errorEmpty}
</p>
) : null}
<button type="submit" className={buttonClass} disabled={disabled} aria-busy={submitting || undefined}>
{submitting ? (
<>
<Loader2 className="cf-blog-grid__spin" size={20} strokeWidth={2.5} aria-hidden="true" />
{nl.submittingLabel}
</>
) : (
nl.button
)}
</button>
<p className="cf-blog-grid__quiet">
<a href={nl.secondaryHref ?? (after.length > 0 ? `#${moreId}` : `#${anchorId}`)}>
{after.length > 0 ? nl.secondaryLabel : nl.secondaryLabelEnd}
</a>
</p>
<p className="cf-blog-grid__privacy">
<Lock className="cf-blog-grid__ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{nl.privacy}
</p>
</form>
</div>
</motion.aside>
)
return (
<section
className={`cf-blog-grid${sceneImage ? " has-photo" : ""}${className ? ` ${className}` : ""}`}
aria-labelledby={`${uid}-title`}
>
<style>{CSS}</style>
<div className="cf-blog-grid__wrap">
<header className="cf-blog-grid__head cf-blog-grid__rise">
<h2 id={`${uid}-title`} className="cf-blog-grid__h2">
{headline}
</h2>
{lead ? <p className="cf-blog-grid__lead">{lead}</p> : null}
</header>
</div>
{sceneImage ? (
<div className="cf-blog-grid__photo">
<img src={sceneImage} alt={sceneImageAlt} width={1600} height={900} decoding="async" />
</div>
) : null}
<div className="cf-blog-grid__wrap">
{featured ? (
<article className="cf-blog-grid__featured cf-blog-grid__rise" aria-labelledby={`${uid}-featured`}>
<div className="cf-blog-grid__flags">
<span className="cf-blog-grid__flag">{copy.featuredFlag}</span>
<span className="cf-blog-grid__chip">{featured.category}</span>
{featured.readTime ? (
<span className="cf-blog-grid__time">
<Clock className="cf-blog-grid__ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{featured.readTime}
</span>
) : null}
</div>
<h3 id={`${uid}-featured`} className="cf-blog-grid__big">
{featured.title}
</h3>
<p className="cf-blog-grid__featured-excerpt">{featured.excerpt}</p>
<div className="cf-blog-grid__featured-foot">
{featuredMeta ? <p className="cf-blog-grid__meta">{featuredMeta}</p> : null}
<a className="cf-blog-grid__btn2" href={featured.href ?? "#"} onClick={open(featured)}>
{copy.featuredAction}
</a>
</div>
</article>
) : null}
<div className="cf-blog-grid__tools">
<div className="cf-blog-grid__filters" role="group" aria-label={copy.filterLabel}>
{[null, ...topics].map((topic) => {
const pressed = active === topic
const total = topic === null ? posts.length : counts[topic] ?? 0
return (
<button
key={topic ?? "__all"}
type="button"
className="cf-blog-grid__filter"
aria-pressed={pressed}
onClick={() => setActive(topic)}
>
{pressed ? (
<motion.span
layoutId={`${uid}-filter`}
className="cf-blog-grid__filter-ind"
aria-hidden="true"
transition={reduce ? { duration: 0 } : { type: "spring", stiffness: 520, damping: 42 }}
/>
) : null}
<span>{topic ?? copy.allLabel}</span>
<span className="cf-blog-grid__filter-count">{total}</span>
</button>
)
})}
</div>
<p className="cf-blog-grid__count" aria-live="polite">
{countText}
</p>
</div>
<div className="cf-blog-grid__grid" id={anchorId}>
<AnimatePresence mode="popLayout" initial={false}>
{cells.map((cell) => (cell.kind === "strip" ? strip : renderPost(cell.post, cell.size, cell.id)))}
</AnimatePresence>
</div>
</div>
</section>
)
}
export default BlogGrid
function fill(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => values[key] ?? match)
}
// Rows of three; a row of two splits the width, a lone card goes wide.
function sizeFor(index: number, length: number): CellSize {
const full = length - (length % 3)
if (index < full) return "third"
return length % 3 === 2 ? "half" : "wide"
}
const CSS = `
.cf-blog-grid{--blog-gutter:clamp(16px,5vw,48px);--blog-ease:cubic-bezier(.2,.7,.2,1);--blog-shadow:var(--shadow,oklch(0.22 0.03 260));--blog-radius:var(--card-radius,var(--radius,14px));--blog-line:var(--card-border,oklch(from var(--ink,#1b2230) l c h / .12));--blog-card-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2)));--blog-lift:var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32));--blog-focus:var(--field-focus,var(--accent,#2f5ad0));position:relative;box-sizing:border-box;padding-block:clamp(56px,8vw,112px) clamp(64px,8.5vw,120px);background:var(--surface,#ffffff);color:var(--ink,#1b2230);font-family:var(--font-body,system-ui,sans-serif);overflow-x:clip}
.cf-blog-grid *,.cf-blog-grid *::before,.cf-blog-grid *::after{box-sizing:border-box}
.cf-blog-grid__wrap{width:100%;max-width:calc(1120px + 2 * var(--blog-gutter));margin-inline:auto;padding-inline:var(--blog-gutter)}
.cf-blog-grid__head{max-width:46rem}
.cf-blog-grid__h2{margin:0 0 16px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--ink,#1b2230)}
.cf-blog-grid__lead{margin:0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted,#4a5568);text-wrap:pretty}
.cf-blog-grid__photo{margin-top:clamp(32px,4vw,48px);height:clamp(260px,38vw,540px);overflow:hidden;background:color-mix(in oklch,var(--ink,#1b2230) 6%,var(--surface,#ffffff))}
.cf-blog-grid__photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 40%}
.cf-blog-grid__featured{position:relative;z-index:1;max-width:720px;margin-top:clamp(32px,4vw,48px);padding:clamp(20px,3vw,32px);background:var(--card,#ffffff);color:var(--ink,#1b2230);border:1px solid oklch(from var(--accent,#2f5ad0) l c h / .35);border-radius:var(--blog-radius);box-shadow:var(--blog-lift)}
.cf-blog-grid.has-photo .cf-blog-grid__featured{margin-top:calc(-1 * clamp(72px,9vw,140px))}
.cf-blog-grid__flags{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:16px}
.cf-blog-grid__flag,.cf-blog-grid__chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap}
.cf-blog-grid__flag{background:var(--accent-fill,var(--accent,#2f5ad0));color:var(--accent-fill-ink,var(--card,#ffffff))}
.cf-blog-grid__chip{align-self:flex-start;background:color-mix(in oklch,var(--ink,#1b2230) 6%,var(--card,#ffffff));color:var(--ink,#1b2230)}
.cf-blog-grid__time{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#4a5568);margin-inline-start:4px}
.cf-blog-grid__ico{display:inline-block;flex:none;vertical-align:-.15em;margin-inline-end:.4em}
.cf-blog-grid__big{margin:0 0 12px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(1.75rem,2.8vw,2.5rem);line-height:1.1;text-wrap:balance}
.cf-blog-grid__featured-excerpt{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.45;font-weight:500;color:var(--muted,#4a5568);text-wrap:pretty}
.cf-blog-grid__featured-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}
.cf-blog-grid__meta{margin:0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#4a5568)}
.cf-blog-grid__btn2{display:inline-flex;align-items:center;justify-content:center;min-height:56px;padding:8px 24px;border-radius:var(--button-radius,var(--radius,12px));border:1px solid var(--button-2-border,transparent);background:var(--button-2-bg,var(--secondary,#e9edf3));color:var(--button-2-ink,var(--secondary-ink,#1b2230));box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14)));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;transition:background .16s ease,transform .16s ease}
.cf-blog-grid__btn2:hover{background:oklch(from var(--button-2-bg,var(--secondary,#e9edf3)) calc(l - .04) c h);transform:translateY(-1px)}
.cf-blog-grid__btn2:active{transform:translateY(1px)}
.cf-blog-grid__btn2:focus-visible{outline:3px solid var(--blog-focus);outline-offset:2px}
.cf-blog-grid__tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;margin-top:clamp(48px,6vw,72px)}
.cf-blog-grid__filters{display:flex;flex-wrap:wrap;gap:8px}
.cf-blog-grid__filter{position:relative;isolation:isolate;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid oklch(from var(--ink,#1b2230) l c h / .14);border-radius:999px;background:var(--card,#ffffff);color:var(--ink,#1b2230);font-family:inherit;font-size:.9375rem;font-weight:700;line-height:1.2;cursor:pointer;transition:background .16s ease,color .16s ease,border-color .16s ease}
.cf-blog-grid__filter:hover{background:color-mix(in oklch,var(--ink,#1b2230) 6%,var(--card,#ffffff))}
.cf-blog-grid__filter[aria-pressed="true"]{background:var(--band,#15223b);border-color:transparent;color:var(--band-ink,#ffffff);transition-delay:.18s}
.cf-blog-grid__filter:focus-visible{outline:3px solid var(--blog-focus);outline-offset:2px}
.cf-blog-grid__filter-ind{position:absolute;inset:-1px;z-index:-1;border-radius:inherit;background:var(--band,#15223b);box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14))}
.cf-blog-grid__filter-count{font-size:.875rem;font-weight:800;font-variant-numeric:tabular-nums;color:var(--muted,#4a5568)}
.cf-blog-grid__filter[aria-pressed="true"] .cf-blog-grid__filter-count{color:var(--band-ink,#ffffff)}
.cf-blog-grid__count{margin:0;font-size:.9375rem;font-weight:600;color:var(--muted,#4a5568);font-variant-numeric:tabular-nums}
.cf-blog-grid__grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:clamp(16px,2vw,24px);margin-top:24px;scroll-margin-top:24px}
.cf-blog-grid__cell{display:flex;min-width:0;scroll-margin-top:24px}
.cf-blog-grid__cell.is-third{grid-column:span 2}
.cf-blog-grid__cell.is-half{grid-column:span 3}
.cf-blog-grid__cell.is-wide,.cf-blog-grid__cell.is-strip{grid-column:1 / -1}
.cf-blog-grid__card{position:relative;flex:1;display:flex;flex-direction:column;min-width:0;padding:12px;background:var(--card,#ffffff);color:var(--ink,#1b2230);border:1px solid var(--blog-line);border-radius:var(--blog-radius);box-shadow:var(--blog-card-shadow);transition:transform .16s ease,box-shadow .16s ease}
.cf-blog-grid__card:has(.cf-blog-grid__title a:focus-visible){outline:3px solid var(--blog-focus);outline-offset:3px}
.cf-blog-grid__media{position:relative;aspect-ratio:16 / 10;overflow:hidden;border-radius:max(0px,calc(var(--blog-radius) - 4px));background:color-mix(in oklch,var(--ink,#1b2230) 6%,var(--card,#ffffff))}
.cf-blog-grid__media img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center;transition:transform .5s var(--blog-ease)}
.cf-blog-grid__body{flex:1;display:flex;flex-direction:column;padding:16px 8px 8px}
.cf-blog-grid__card.is-text .cf-blog-grid__body{padding-top:12px}
.cf-blog-grid__title{margin:12px 0 8px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-blog-grid__title a{color:inherit;text-decoration:none;text-decoration-thickness:2px;text-underline-offset:.15em;text-decoration-color:oklch(from var(--ink,#1b2230) l c h / .35)}
.cf-blog-grid__title a:focus-visible{outline:none}
.cf-blog-grid__title a::after{content:"";position:absolute;inset:0;z-index:1;border-radius:inherit}
.cf-blog-grid__excerpt{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted,#4a5568);text-wrap:pretty}
.cf-blog-grid__card-meta{margin:auto 0 0;padding-top:16px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#4a5568)}
.cf-blog-grid__cell.is-wide .cf-blog-grid__card{flex-direction:row}
.cf-blog-grid__cell.is-wide .cf-blog-grid__media{flex:0 0 52%;aspect-ratio:auto;min-height:300px}
.cf-blog-grid__cell.is-wide .cf-blog-grid__body{justify-content:center;padding:24px 24px 16px 32px}
.cf-blog-grid__cell.is-wide .cf-blog-grid__card-meta{margin-top:0}
.cf-blog-grid__strip{flex:1;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:clamp(32px,5vw,64px);align-items:start;padding:clamp(24px,4vw,48px);border-radius:var(--blog-radius);background:var(--band,#15223b);color:var(--band-ink,#ffffff);box-shadow:var(--blog-card-shadow)}
.cf-blog-grid__strip .cf-blog-grid__big{margin:0;color:var(--band-ink,#ffffff)}
.cf-blog-grid__strip :focus-visible{outline:3px solid var(--band-ink,#ffffff);outline-offset:3px}
.cf-blog-grid__salute{margin:24px 0 8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.5}
.cf-blog-grid__para{margin:0 0 12px;max-width:60ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.55;text-wrap:pretty}
.cf-blog-grid__closing{margin:16px 0 4px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5}
.cf-blog-grid__sign{margin:0;display:flex;flex-direction:column;gap:4px}
.cf-blog-grid__sign-name{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15}
.cf-blog-grid__sign-role{font-size:.9375rem;font-weight:500;line-height:1.4}
.cf-blog-grid__form{display:flex;flex-direction:column;padding:clamp(20px,3vw,32px);border-radius:max(0px,calc(var(--blog-radius) - 2px));background:color-mix(in oklch,var(--band-ink,#ffffff) 8%,var(--band,#15223b))}
.cf-blog-grid__label{margin:0 0 8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.3;color:var(--band-ink,#ffffff)}
.cf-blog-grid__field{width:100%;min-height:56px;padding:0 16px;border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#1b2230) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field,#ffffff);color:var(--field-ink,#101828);font-family:inherit;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;transition:border-color .16s ease,box-shadow .16s ease}
.cf-blog-grid__field::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#ffffff));opacity:1}
.cf-blog-grid__field:focus{border-color:var(--blog-focus);box-shadow:0 0 0 3px oklch(from var(--blog-focus) l c h / .35)}
.cf-blog-grid__field[aria-invalid="true"]{border-color:var(--danger,#b42318);box-shadow:0 0 0 3px oklch(from var(--danger,#b42318) l c h / .3)}
.cf-blog-grid__field:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink,#101828) 6%,var(--field,#ffffff))}
.cf-blog-grid__error{margin:8px 0 0;padding:8px 12px;border-radius:8px;background:var(--danger-soft,#fdecea);color:var(--danger,#b42318);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-blog-grid__btn{display:flex;width:100%;align-items:center;justify-content:center;gap:8px;min-height:56px;margin-top:12px;padding:8px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;color:var(--button-ink,var(--cta-ink,#ffffff));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2,#a81d14)) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l - .16) c h),0 1px 2px oklch(from var(--blog-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--blog-shadow) l c h / .45));cursor:pointer;transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
.cf-blog-grid__btn:not(:disabled):hover,.cf-blog-grid__btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2,#a81d14)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l - .18) c h),0 1px 2px oklch(from var(--blog-shadow) l c h / .32),0 10px 18px -6px oklch(from var(--blog-shadow) l c h / .55))}
.cf-blog-grid__btn:not(:disabled):active,.cf-blog-grid__btn.is-active:not(:disabled){transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l - .2) c h / .45),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta,#d12a1e)) calc(l - .16) c h),0 1px 1px oklch(from var(--blog-shadow) l c h / .3)}
.cf-blog-grid__btn:disabled{cursor:not-allowed;background:var(--secondary,#e9edf3);color:var(--secondary-ink,#1b2230);text-shadow:none;box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14))}
.cf-blog-grid__btn[aria-busy="true"]{cursor:progress}
.cf-blog-grid__spin{animation:cf-blog-spin .8s linear infinite}
.cf-blog-grid__quiet{margin:12px 0 0;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4}
.cf-blog-grid__quiet a{color:var(--band-ink,#ffffff);text-decoration:underline;text-underline-offset:.18em;text-decoration-color:oklch(from var(--band-ink,#ffffff) l c h / .5)}
.cf-blog-grid__quiet a:hover{text-decoration-color:var(--band-ink,#ffffff)}
.cf-blog-grid__privacy{margin:12px 0 0;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--band-ink,#ffffff);text-wrap:pretty}
.cf-blog-grid__rise{animation:cf-blog-rise .45s var(--blog-ease) both}
.cf-blog-grid__featured.cf-blog-grid__rise{animation-delay:.07s}
@keyframes cf-blog-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-blog-spin{to{transform:rotate(360deg)}}
@media (hover:hover){
.cf-blog-grid__card:hover{transform:translateY(-3px);box-shadow:var(--blog-lift)}
.cf-blog-grid__card:hover .cf-blog-grid__media img{transform:scale(1.04)}
.cf-blog-grid__card:hover .cf-blog-grid__title a{text-decoration-line:underline}
}
@media (max-width:960px){
.cf-blog-grid__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.cf-blog-grid__cell.is-third,.cf-blog-grid__cell.is-half{grid-column:span 1}
.cf-blog-grid__strip{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:640px){
.cf-blog-grid__grid{grid-template-columns:minmax(0,1fr)}
.cf-blog-grid__cell.is-wide .cf-blog-grid__card{flex-direction:column}
.cf-blog-grid__cell.is-wide .cf-blog-grid__media{flex:none;aspect-ratio:16 / 10;min-height:0}
.cf-blog-grid__cell.is-wide .cf-blog-grid__body{padding:16px 8px 8px}
.cf-blog-grid__cell.is-wide .cf-blog-grid__card-meta{margin-top:auto}
.cf-blog-grid__featured-foot .cf-blog-grid__btn2{width:100%}
.cf-blog-grid__tools{align-items:flex-start}
}
@media (prefers-reduced-motion:reduce){
.cf-blog-grid__rise,.cf-blog-grid__spin{animation:none}
.cf-blog-grid__card,.cf-blog-grid__media img,.cf-blog-grid__btn,.cf-blog-grid__btn2,.cf-blog-grid__filter,.cf-blog-grid__field{transition:none}
.cf-blog-grid__card:hover,.cf-blog-grid__btn2:hover{transform:none}
.cf-blog-grid__card:hover .cf-blog-grid__media img{transform:none}
}
`
pieces/content/blog-grid/specimen.tsx 112 lines
import __studioImagec5e50f57 from "../assets/ca61acd89341dc30.webp";
import __studioImagea6ef0607 from "../assets/6f6b1895da6e1eeb.webp";
import __studioImage634a1169 from "../assets/e79bed26ce50023b.webp";
import * as React from "react"
import { BlogGrid } from "../blog-grid"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled", "error"]
type SpecimenState = "default" | "hover" | "active" | "disabled" | "error"
export default function BlogGridSpecimen({ state = "default" }: { state?: SpecimenState }) {
const sample = defaults.sample
const [guide, workbook, checklist] = sample.items
return (
<BlogGrid
state={state}
headline="Plays that get your first funnel live"
lead="Short, practical reads on planning, page copy and launch. Pick a topic, or start with the featured play below."
sceneImage={slot(
"scene",
__studioImagec5e50f57,
)}
sceneImageAlt="A founder sketching a simple funnel plan at a sunlit desk"
featured={{
category: "Planning",
title: "Plan your first funnel in one evening, page by page",
excerpt: "Map the offer, the opt-in and the thank-you page before you write a word. Here is the order that keeps it simple.",
author: "Sam Carter",
date: "Nov 20",
readTime: "8 min read",
href: "#",
}}
posts={[
{
category: "Copy",
title: "Write a headline that makes one specific promise",
excerpt: "Swap the clever line for a clear one. Three workbook prompts to say who it is for and what they get.",
image: slot("item-2", workbook.image),
imageAlt: workbook.imageAlt,
date: "Nov 18",
readTime: "6 min read",
href: "#",
},
{
category: "Planning",
title: "The three pages every starter funnel needs",
excerpt: "An opt-in, a thank-you page and one offer. What goes on each, and what to leave off for now.",
image: slot("item-1", guide.image),
imageAlt: guide.imageAlt,
date: "Nov 13",
readTime: "5 min read",
href: "#",
},
{
category: "Launch",
title: "Check these nine things before you share your link",
excerpt: "Broken forms and missing redirects cost the most on day one. Run this list in fifteen minutes.",
image: slot("item-3", checklist.image),
imageAlt: checklist.imageAlt,
date: "Nov 6",
readTime: "4 min read",
href: "#",
},
{
category: "Copy",
title: "Turn every bullet into a reason to keep reading",
excerpt: "Name the benefit, hold back the how. Three rewrites, before and after.",
image: slot(
"item-4",
__studioImagea6ef0607,
),
imageAlt: "A hand highlighting one line on a printed sales page",
date: "Oct 30",
readTime: "7 min read",
href: "#",
},
{
category: "Offers",
title: "Price your first offer without guessing",
excerpt: "Start from what the buyer gets, not what others charge. A simple way to pick your first number.",
image: slot(
"item-5",
__studioImage634a1169,
),
imageAlt: "A business owner checking a pricing sheet on a tablet",
date: "Oct 23",
readTime: "6 min read",
href: "#",
},
]}
newsletter={{
heading: "Get one practical funnel play every week",
salutation: "Dear friend,",
paragraphs: [
"Most first funnels stall before a single page goes live. Not because the idea is weak. Because the plan is missing.",
"So once a week I send you one short play from this blog: a headline to try, a page to fix, a step to check before you launch.",
],
closing: "Talk soon,",
signoff: "Sam Carter",
role: "Editor, The Funnel Starter blog",
label: "Your best email",
placeholder: "you@example.com",
button: "Send Me the Next Play",
secondaryLabel: "or keep browsing the articles below",
privacy: sample.registration.privacy,
}}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalBlogGrid |
React.ReactNode |
|
lead OptionalBlogGrid |
React.ReactNode |
|
sceneImage OptionalBlogGrid |
string |
|
sceneImageAlt OptionalBlogGrid |
string |
|
featured OptionalBlogGrid |
BlogPost |
|
posts OptionalBlogGrid |
BlogPost[] |
|
categories OptionalBlogGrid |
string[] |
|
newsletter OptionalBlogGrid |
Partial<BlogGridNewsletter> |
|
showNewsletter OptionalBlogGrid |
boolean |
|
newsletterAt OptionalBlogGrid |
number |
|
copy OptionalBlogGrid |
Partial<BlogGridCopy> |
|
anchorId OptionalBlogGrid |
string |
|
submitting OptionalBlogGrid |
boolean |
|
onSubmit OptionalBlogGrid |
(values: { email: string }) => void |
|
onAction OptionalBlogGrid |
(post: BlogPost) => void |
|
state OptionalBlogGrid |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalBlogGrid |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-4- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-5- One image per offer item (item-1, item-2…), shown in stacks and lists.
scene- A wide atmosphere photo behind or beside the copy.
-
6f6b1895da6e1eeb.webp
image/webp · 45.9 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
ca61acd89341dc30.webp
image/webp · 84.6 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e79bed26ce50023b.webp
image/webp · 87.9 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB