Speaker Grid 4
The line-up deck: speaker cards fanned like a hand on a colour-blocked band, each one a reason to come, with the
Use it in a prompt
Use content/speaker-grid-4 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/speaker-grid-4.tsx. - Import it and pass your copy and images (Props tab):
import { SpeakerGrid4 } from "@/components/funneldna/content/speaker-grid-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/speaker-grid-4/component.tsx 524 lines
// layout: card-fan
// The line-up deck: speaker cards fanned like a hand on a colour-blocked band, each one a reason to come, with the
// ticket close beside the deck so curiosity about the next talk carries straight into the ticket button.
import * as React from "react"
import { AlertCircle, CalendarDays, Check, ChevronLeft, ChevronRight, Lock } from "lucide-react"
import { FX_HOST, Pattern, Spot } from "../fx/fx"
export type DeckSpeaker = {
name: string
/** Credential exactly as supplied; leave it out when there is none. */
credential?: string
/** The talk promise: what the visitor takes away from this session. */
talk: React.ReactNode
/** Day id from `days`, or a label shown as is. */
day?: string
/** Portrait src. */
photo?: string
/** Defaults to copy.photoAlt ("{name}, {credential}"). */
photoAlt?: string
/** An imported fx spot illustration, shown when there is no photo. */
art?: string
}
export type DeckDay = { id: string; label: string }
export type SpeakerGrid4Copy = {
/** Accessible name of the deck. */
deckLabel: string
/** Accessible name of the top card: "{index} of {total}: {name}". */
slideLabel: string
/** Visible position counter: "{index} / {total}". */
counter: string
prevLabel: string
nextLabel: string
/** Short line under the deck controls. */
hint: string
/** Portrait alt when a speaker has no photoAlt: "{name}, {credential}". */
photoAlt: string
/** Portrait alt when a speaker has no credential: "{name}". */
photoAltName: string
/** Screen-reader label before the slashed price. */
regularLabel: string
/** Screen-reader label before today's price. */
todayLabel: string
/** Inline error when the commit box is unticked at click time. */
commitError: string
}
export type SpeakerGrid4Props = {
headline?: React.ReactNode
lead?: React.ReactNode
/** Only these speakers render; defaults to none. */
speakers?: DeckSpeaker[]
/** Day ids and labels for the card chips. */
days?: DeckDay[]
/** Which card is on top first. */
initialIndex?: number
reasonsHeadline?: React.ReactNode
/** Reasons set inline, each led by an accent numeral. */
reasons?: React.ReactNode[]
/** Regular price, slashed in the danger colour. Shown only with `price`. */
regularPrice?: string
/** Today's ticket price; the price row shows only when supplied. */
price?: string
/** Short line beside the price, e.g. "per ticket · both days". */
priceNote?: string
/** Commit line above the button; the checkbox shows only when supplied. */
commitLabel?: React.ReactNode
/** Whether the commit box starts ticked (default true). */
commitDefault?: boolean
ctaLabel?: string
/** One short reassurance line under the button. */
ctaNote?: string
/** Navigation destination of the ticket button. */
href?: string
/** Ticket click; the builder wires what happens next. */
onAction?: () => void
disabled?: boolean
/** Accessible names, counter, alt and validation templates. */
copy?: Partial<SpeakerGrid4Copy>
state?: "default" | "hover" | "active" | "disabled" | "error"
className?: string
}
const DEFAULT_COPY: SpeakerGrid4Copy = {
deckLabel: "Speaker line-up",
slideLabel: "{index} of {total}: {name}",
counter: "{index} / {total}",
prevLabel: "Previous speaker",
nextLabel: "Next speaker",
hint: "Swipe, drag or use the arrow keys",
photoAlt: "{name}, {credential}",
photoAltName: "{name}",
regularLabel: "Regular price",
todayLabel: "Today's price",
commitError: "Tick the box to confirm you've read the guarantee.",
}
const SWIPE = 56
const FAN = 2
type Drag = { id: number; x: number; y: number; dx: number; moved: boolean }
export function SpeakerGrid4(props: SpeakerGrid4Props) {
const {
headline = "Meet the speakers on your ticket",
lead = "Flip through the line-up, then grab your ticket.",
speakers = [],
days = [],
initialIndex = 0,
reasonsHeadline = "Three reasons to get your ticket today",
reasons = ["One ticket covers every talk.", "Every talk ends with a plan you can use.", "Checkout takes about a minute."],
regularPrice,
price,
priceNote,
commitLabel,
commitDefault = true,
ctaLabel = "Get My Ticket",
ctaNote = "Secure checkout",
href,
onAction,
disabled = false,
copy,
state = "default",
className,
} = props
const c = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const checkId = `${uid}-commit`
const errId = `${uid}-commit-error`
const count = speakers.length
const last = Math.max(count - 1, 0)
const [picked, setPicked] = React.useState(() => clamp(initialIndex, 0, last))
const active = clamp(picked, 0, last)
const [live, setLive] = React.useState("")
const [dragX, setDragX] = React.useState(0)
const [dragging, setDragging] = React.useState(false)
const [committed, setCommitted] = React.useState(state === "error" ? false : commitDefault)
const [err, setErr] = React.useState(state === "error")
const drag = React.useRef<Drag | null>(null)
const suppress = React.useRef(false)
const focusCard = React.useRef(false)
const cardRefs = React.useRef<(HTMLElement | null)[]>([])
const prevRef = React.useRef<HTMLButtonElement | null>(null)
const nextRef = React.useRef<HTMLButtonElement | null>(null)
const checkRef = React.useRef<HTMLInputElement | null>(null)
const isDisabled = disabled || state === "disabled"
const showErr = Boolean(commitLabel) && err && !committed
React.useEffect(() => {
if (state === "error") {
setCommitted(false)
setErr(true)
} else {
setErr(false)
setCommitted(commitDefault)
}
}, [state, commitDefault])
React.useEffect(() => {
if (!focusCard.current) return
focusCard.current = false
cardRefs.current[active]?.focus({ preventScroll: true })
}, [active])
const go = (target: number, opts: { focus?: boolean; from?: "prev" | "next" } = {}) => {
const t = clamp(target, 0, last)
if (!count || t === active) return
setPicked(t)
setLive(fill(c.slideLabel, { index: t + 1, total: count, name: speakers[t].name }))
if (opts.focus) focusCard.current = true
if (opts.from === "next" && t === last) prevRef.current?.focus()
if (opts.from === "prev" && t === 0) nextRef.current?.focus()
}
const onKey = (e: React.KeyboardEvent<HTMLDivElement>) => {
const map: Record<string, number> = { ArrowLeft: active - 1, ArrowRight: active + 1, Home: 0, End: last }
if (!(e.key in map)) return
e.preventDefault()
go(map[e.key], { focus: true })
}
const onDown = (e: React.PointerEvent<HTMLDivElement>) => {
suppress.current = false
if (count < 2 || (e.pointerType === "mouse" && e.button !== 0)) return
drag.current = { id: e.pointerId, x: e.clientX, y: e.clientY, dx: 0, moved: false }
}
const onMove = (e: React.PointerEvent<HTMLDivElement>) => {
const d = drag.current
if (!d || d.id !== e.pointerId) return
let dx = e.clientX - d.x
const dy = e.clientY - d.y
if (!d.moved) {
if (Math.abs(dx) < 8 || Math.abs(dx) < Math.abs(dy)) {
if (Math.abs(dy) > 12) drag.current = null
return
}
d.moved = true
setDragging(true)
try {
e.currentTarget.setPointerCapture(e.pointerId)
} catch {
// capture is a nicety; dragging still works without it
}
}
if ((active === 0 && dx > 0) || (active === last && dx < 0)) dx *= 0.3
d.dx = Math.max(-220, Math.min(220, dx))
setDragX(d.dx)
}
const endDrag = (e: React.PointerEvent<HTMLDivElement>, cancel: boolean) => {
const d = drag.current
if (!d || d.id !== e.pointerId) return
drag.current = null
if (!d.moved) return
suppress.current = true
setDragging(false)
setDragX(0)
if (cancel) return
if (d.dx <= -SWIPE) go(active + 1)
else if (d.dx >= SWIPE) go(active - 1)
}
const dayLabel = (id?: string) => (id ? days.find((d) => d.id === id)?.label ?? id : undefined)
const altFor = (s: DeckSpeaker) =>
s.photoAlt ??
(s.credential ? fill(c.photoAlt, { name: s.name, credential: s.credential }) : fill(c.photoAltName, { name: s.name }))
const onTicket = (e: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
e.preventDefault()
return
}
if (commitLabel && !committed) {
e.preventDefault()
setErr(true)
checkRef.current?.focus()
return
}
onAction?.()
}
const ctaClass = ["sg4-cta", state === "hover" && "is-hover", state === "active" && "is-press"].filter(Boolean).join(" ")
const cta =
href && !isDisabled ? (
<a className={ctaClass} href={href} onClick={onTicket}>
{ctaLabel}
</a>
) : (
<button type="button" className={ctaClass} disabled={isDisabled} onClick={onTicket}>
{ctaLabel}
</button>
)
return (
<section className={["cf-speaker-grid-4", className].filter(Boolean).join(" ")} style={FX_HOST}>
<style>{CSS}</style>
<Pattern name="plus" fade="edges" />
<div className={count ? "sg4-wrap" : "sg4-wrap is-solo"}>
<header className="sg4-head">
<h2 className="sg4-h">{headline}</h2>
{lead ? <p className="sg4-lede">{lead}</p> : null}
</header>
{count ? (
<div className="sg4-deck">
<div
className={dragging ? "sg4-stage is-dragging" : "sg4-stage"}
role="region"
aria-roledescription="carousel"
aria-label={c.deckLabel}
onKeyDown={onKey}
onPointerDown={onDown}
onPointerMove={onMove}
onPointerUp={(e) => endDrag(e, false)}
onPointerCancel={(e) => endDrag(e, true)}
>
{speakers.map((s, i) => {
const k = i - active
const a = Math.abs(k)
const top = k === 0
const cls = ["sg4-card", top ? "is-top" : k < 0 ? "is-before" : "is-after", a > FAN && "is-hidden"]
.filter(Boolean)
.join(" ")
const style = {
"--k": k,
"--a": a,
zIndex: 40 - a,
...(top && dragX ? { "--dx": `${dragX}px`, "--dr": `${dragX * 0.04}deg` } : {}),
} as React.CSSProperties
const day = dayLabel(s.day)
return (
<article
key={`${s.name}-${i}`}
ref={(el) => {
cardRefs.current[i] = el
}}
className={cls}
style={style}
data-a={a}
tabIndex={top ? 0 : -1}
aria-hidden={top ? undefined : true}
aria-roledescription={top ? "slide" : undefined}
aria-label={top ? fill(c.slideLabel, { index: i + 1, total: count, name: s.name }) : undefined}
onClick={() => {
if (suppress.current) {
suppress.current = false
return
}
if (!top) go(i)
}}
>
{s.photo || s.art ? (
<div className={s.photo ? "sg4-art" : "sg4-art is-spot"}>
{s.photo ? (
<img src={s.photo} alt={altFor(s)} draggable={false} loading={a > 1 ? "lazy" : undefined} />
) : s.art ? (
<Spot src={s.art} size={136} />
) : null}
</div>
) : null}
<div className="sg4-body">
{day ? (
<span className="sg4-day">
<CalendarDays size={16} strokeWidth={2.5} aria-hidden="true" />
{day}
</span>
) : null}
<h3 className="sg4-name">{s.name}</h3>
{s.credential ? <p className="sg4-cred">{s.credential}</p> : null}
<p className="sg4-talk">{s.talk}</p>
</div>
</article>
)
})}
</div>
{count > 1 ? (
<div className="sg4-controls">
<button
ref={prevRef}
type="button"
className="sg4-nav"
aria-label={c.prevLabel}
disabled={active === 0}
onClick={() => go(active - 1, { from: "prev" })}
>
<ChevronLeft size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
<span className="sg4-count" aria-hidden="true">
{fill(c.counter, { index: active + 1, total: count })}
</span>
<button
ref={nextRef}
type="button"
className="sg4-nav"
aria-label={c.nextLabel}
disabled={active === last}
onClick={() => go(active + 1, { from: "next" })}
>
<ChevronRight size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
) : null}
{count > 1 && c.hint ? <p className="sg4-hint">{c.hint}</p> : null}
<p className="sg4-sr" aria-live="polite">
{live}
</p>
</div>
) : null}
<div className="sg4-ticket">
{reasonsHeadline ? <h3 className="sg4-rh">{reasonsHeadline}</h3> : null}
{reasons.length ? (
<ol className="sg4-reasons">
{reasons.map((r, i) => (
<li className="sg4-reason" key={i}>
<span className="sg4-num" aria-hidden="true">
{i + 1}
</span>
<span className="sg4-rtext">{r}</span>
</li>
))}
</ol>
) : null}
{price ? (
<p className="sg4-price">
{regularPrice ? (
<s className="sg4-was">
<span className="sg4-sr">{c.regularLabel} </span>
{regularPrice}
</s>
) : null}
<span className="sg4-now">
<span className="sg4-sr">{c.todayLabel} </span>
{price}
</span>
{priceNote ? <span className="sg4-pnote">{priceNote}</span> : null}
</p>
) : null}
{commitLabel ? (
<>
<label className={showErr ? "sg4-commit is-invalid" : "sg4-commit"} htmlFor={checkId}>
<input
id={checkId}
ref={checkRef}
type="checkbox"
checked={committed}
disabled={isDisabled}
aria-invalid={showErr || undefined}
aria-describedby={showErr ? errId : undefined}
onChange={(e) => {
setCommitted(e.target.checked)
if (e.target.checked) setErr(false)
}}
/>
<span className="sg4-box" aria-hidden="true">
<Check size={16} strokeWidth={3} />
</span>
<span className="sg4-ctext">{commitLabel}</span>
</label>
{showErr ? (
<p className="sg4-err" id={errId} role="alert">
<AlertCircle className="sg4-inline-icon" size={16} strokeWidth={2.5} aria-hidden="true" />
{c.commitError}
</p>
) : null}
</>
) : null}
{cta}
{ctaNote ? (
<p className="sg4-note">
<Lock className="sg4-inline-icon" size={16} strokeWidth={2.5} aria-hidden="true" />
{ctaNote}
</p>
) : null}
</div>
</div>
</section>
)
}
export default SpeakerGrid4
function clamp(n: number, min: number, max: number) {
return Math.min(Math.max(n, min), max)
}
function fill(template: string, values: Record<string, string | number>) {
return Object.keys(values).reduce((out, key) => out.split("{" + key + "}").join(String(values[key])), template)
}
const SHADOW_MD = "var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2))"
const SHADOW_LG = "var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 260 / 0.32))"
const SH = "oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h"
const BTN = "var(--button-bg, var(--cta))"
const BTN2 = "var(--button-bg-2, var(--cta-2))"
const CSS = `
.cf-speaker-grid-4{position:relative;overflow-x:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-speaker-grid-4 *,.cf-speaker-grid-4 *::before,.cf-speaker-grid-4 *::after{box-sizing:border-box}
.cf-speaker-grid-4 :where(h2,h3,p,ol,li){margin:0}
.cf-speaker-grid-4 .sg4-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);grid-template-areas:"head deck" "ticket deck";grid-template-rows:auto 1fr;column-gap:clamp(32px,5vw,72px);row-gap:32px;align-items:start}
.cf-speaker-grid-4 .sg4-wrap.is-solo{grid-template-columns:minmax(0,46rem);grid-template-areas:"head" "ticket";grid-template-rows:auto;justify-content:center}
.cf-speaker-grid-4 .sg4-head{grid-area:head}
.cf-speaker-grid-4 .sg4-h{font-family:var(--font-display);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(--band-ink)}
.cf-speaker-grid-4 .sg4-lede{margin-top:16px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:var(--band-ink)}
.cf-speaker-grid-4 .sg4-deck{grid-area:deck;position:relative;display:flex;flex-direction:column;align-items:center;gap:20px;padding:40px 20px 28px;border-radius:var(--card-radius,var(--radius,14px));background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-speaker-grid-4 .sg4-stage{--fx:12px;--fr:3.25deg;--fy:6px;position:relative;display:grid;justify-items:center;width:100%;padding-bottom:28px;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.cf-speaker-grid-4 .sg4-card{grid-area:1/1;position:relative;display:flex;flex-direction:column;gap:16px;width:288px;max-width:100%;padding:12px 12px 22px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,${SHADOW_MD});transform-origin:50% 125%;transform:translateX(calc(var(--k) * var(--fx) + var(--dx,0px))) translateY(calc(var(--a) * var(--fy))) rotate(calc(var(--k) * var(--fr) + var(--dr,0deg))) scale(calc(1 - var(--a) * 0.035));transition:transform .45s cubic-bezier(.2,.7,.2,1),opacity .3s ease,translate .16s ease,box-shadow .16s ease;cursor:pointer;outline:none}
.cf-speaker-grid-4 .sg4-card::after{content:"";position:absolute;inset:-1px;border-radius:inherit;background:oklch(from var(--band) l c h / calc(var(--a) * 0.07));pointer-events:none;transition:background .3s ease}
.cf-speaker-grid-4 .sg4-card.is-top{box-shadow:${SHADOW_LG};cursor:grab}
.cf-speaker-grid-4 .sg4-card.is-top:focus-visible{outline:3px solid var(--accent-fill-ink,var(--card));outline-offset:4px}
.cf-speaker-grid-4 .sg4-stage.is-dragging .sg4-card.is-top{transition:opacity .3s ease;cursor:grabbing}
.cf-speaker-grid-4 .sg4-card.is-hidden{opacity:0;visibility:hidden;pointer-events:none}
@media (hover:hover){.cf-speaker-grid-4 .sg4-card:is(.is-before,.is-after):not(.is-hidden):hover{translate:0 -8px}}
.cf-speaker-grid-4 .sg4-art{position:relative;overflow:hidden;aspect-ratio:20/17;border-radius:12px;background:color-mix(in oklch,var(--ink) 6%,var(--card))}
.cf-speaker-grid-4 .sg4-art.is-spot{display:grid;place-items:center;background:transparent}
.cf-speaker-grid-4 .sg4-art img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 22%;pointer-events:none;-webkit-user-drag:none}
.cf-speaker-grid-4 .sg4-body{display:flex;flex-direction:column;align-items:flex-start;padding:0 8px}
.cf-speaker-grid-4 .sg4-day{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
.cf-speaker-grid-4 .sg4-name{margin-top:12px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;color:var(--ink)}
.cf-speaker-grid-4 .sg4-cred{margin-top:4px;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-speaker-grid-4 .sg4-talk{margin-top:12px;font-size:1.0625rem;font-weight:500;line-height:1.45;text-wrap:pretty;color:var(--ink)}
.cf-speaker-grid-4 .sg4-controls{display:flex;align-items:center;justify-content:center;gap:16px}
.cf-speaker-grid-4 .sg4-nav{display:inline-grid;place-items:center;inline-size:48px;block-size:48px;padding:0;border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--button-radius,var(--radius,12px));background:var(--card);color:var(--ink);box-shadow:var(--shadow-sm,${SHADOW_MD});cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-speaker-grid-4 .sg4-nav:hover:not(:disabled){background:color-mix(in oklch,var(--ink) 8%,var(--card))}
.cf-speaker-grid-4 .sg4-nav:active:not(:disabled){transform:translateY(1px);box-shadow:none}
.cf-speaker-grid-4 .sg4-nav:focus-visible{outline:3px solid var(--accent-fill-ink,var(--card));outline-offset:3px}
.cf-speaker-grid-4 .sg4-nav:disabled{opacity:.45;box-shadow:none;cursor:not-allowed}
.cf-speaker-grid-4 .sg4-count{min-width:5ch;text-align:center;font-family:var(--font-display);font-weight:800;font-size:1.25rem;line-height:1;font-variant-numeric:tabular-nums;color:var(--accent-fill-ink,var(--card))}
.cf-speaker-grid-4 .sg4-hint{font-size:.9375rem;font-weight:600;line-height:1.4;text-align:center;color:var(--accent-fill-ink,var(--card))}
.cf-speaker-grid-4 .sg4-ticket{grid-area:ticket;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,${SHADOW_MD});padding:clamp(20px,3vw,32px)}
.cf-speaker-grid-4 .sg4-rh{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;color:var(--ink)}
.cf-speaker-grid-4 .sg4-reasons{list-style:none;padding:0;margin-top:16px;display:grid;gap:12px}
.cf-speaker-grid-4 .sg4-reason{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:baseline;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.45;font-weight:500;color:var(--ink)}
.cf-speaker-grid-4 .sg4-rtext{text-wrap:pretty}
.cf-speaker-grid-4 .sg4-num{font-family:var(--font-display);font-weight:800;font-size:1.3125rem;line-height:1;color:var(--accent);font-variant-numeric:tabular-nums;text-align:center}
.cf-speaker-grid-4 .sg4-price{display:flex;flex-wrap:wrap;align-items:center;gap:14px 20px;margin-top:28px}
.cf-speaker-grid-4 .sg4-was{position:relative;display:inline-block;padding:0 4px;font-family:var(--font-display);font-weight:800;font-size:clamp(1.5rem,2.2vw,2rem);line-height:1;color:var(--muted);text-decoration:none;font-variant-numeric:tabular-nums}
.cf-speaker-grid-4 .sg4-was::after{content:"";position:absolute;left:-4px;right:-4px;top:50%;height:.12em;margin-top:-.06em;border-radius:999px;background:var(--danger);transform:rotate(-12deg)}
.cf-speaker-grid-4 .sg4-now{display:inline-block;font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-speaker-grid-4 .sg4-pnote{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-speaker-grid-4 .sg4-commit{position:relative;display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;margin-top:24px;cursor:pointer;font-size:1rem;font-weight:600;line-height:1.45;color:var(--label-ink,var(--ink));text-wrap:pretty}
.cf-speaker-grid-4 .sg4-commit input{position:absolute;top:0;left:0;width:24px;height:24px;margin:0;opacity:0;cursor:pointer}
.cf-speaker-grid-4 .sg4-box{display:grid;place-items:center;width:24px;height:24px;margin-top:1px;border:2px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:6px;background:var(--field);color:transparent;transition:background .16s ease,border-color .16s ease}
.cf-speaker-grid-4 .sg4-commit input:checked+.sg4-box{background:var(--success);border-color:var(--success);color:var(--success-ink,#fff)}
.cf-speaker-grid-4 .sg4-commit input:focus-visible+.sg4-box{border-color:var(--field-focus,var(--accent));outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.35);outline-offset:1px}
.cf-speaker-grid-4 .sg4-commit.is-invalid .sg4-box{border-color:var(--danger)}
.cf-speaker-grid-4 .sg4-commit input:disabled{cursor:not-allowed}
.cf-speaker-grid-4 .sg4-err{margin-top:8px;padding-inline-start:36px;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-speaker-grid-4 .sg4-inline-icon{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-speaker-grid-4 .sg4-cta{display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;margin-top:24px;padding:0 28px;text-wrap:balance;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from ${BTN} calc(l + 0.04) c h),oklch(from ${BTN2} calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));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;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from ${BTN} calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from ${BTN} calc(l - 0.16) c h),0 1px 2px ${SH} / 0.3),0 8px 16px -6px ${SH} / 0.45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease;-webkit-tap-highlight-color:transparent}
.cf-speaker-grid-4 .sg4-cta:hover:not(:disabled),.cf-speaker-grid-4 .sg4-cta.is-hover{background:linear-gradient(oklch(from ${BTN} calc(l - 0.01) c h),oklch(from ${BTN2} calc(l - 0.07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from ${BTN} calc(l + 0.12) c h / 0.7),inset 0 -3px 0 oklch(from ${BTN} calc(l - 0.2) c h),0 1px 2px ${SH} / 0.32),0 10px 18px -6px ${SH} / 0.55))}
.cf-speaker-grid-4 .sg4-cta:active:not(:disabled),.cf-speaker-grid-4 .sg4-cta.is-press{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from ${BTN} calc(l - 0.22) c h / 0.5),inset 0 -2px 0 oklch(from ${BTN} calc(l - 0.16) c h),0 1px 2px ${SH} / 0.3)}
.cf-speaker-grid-4 .sg4-cta:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-speaker-grid-4 .sg4-cta:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));text-shadow:none;cursor:not-allowed}
.cf-speaker-grid-4 .sg4-note{margin-top:12px;text-align:center;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-speaker-grid-4 .sg4-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@media (max-width:1100px){.cf-speaker-grid-4 .sg4-wrap{grid-template-columns:minmax(0,46rem);grid-template-areas:"head" "deck" "ticket";grid-template-rows:auto;justify-content:center}.cf-speaker-grid-4 .sg4-head{text-align:center}.cf-speaker-grid-4 .sg4-lede{margin-inline:auto}}
@media (max-width:640px){.cf-speaker-grid-4 .sg4-wrap{row-gap:24px}.cf-speaker-grid-4 .sg4-cta{padding:0 12px}.cf-speaker-grid-4 .sg4-stage{padding-bottom:24px}.cf-speaker-grid-4 .sg4-deck{overflow:hidden;padding:28px 16px 20px;gap:16px}.cf-speaker-grid-4 .sg4-stage{--fx:14px;--fr:3deg}.cf-speaker-grid-4 .sg4-card{width:min(272px,calc(100% - 56px))}.cf-speaker-grid-4 .sg4-card.is-before{opacity:0;visibility:hidden;pointer-events:none}}
@media (prefers-reduced-motion:reduce){.cf-speaker-grid-4 .sg4-card,.cf-speaker-grid-4 .sg4-card::after,.cf-speaker-grid-4 .sg4-cta,.cf-speaker-grid-4 .sg4-nav,.cf-speaker-grid-4 .sg4-box{transition:none}.cf-speaker-grid-4 .sg4-card:is(.is-before,.is-after):not(.is-hidden):hover{translate:none}}
`
pieces/content/speaker-grid-4/specimen.tsx 94 lines
import __studioImage49e7652b from "../assets/d5100d8143495aeb.webp";
import __studioImage2ad62221 from "../assets/e298de079d15a65c.webp";
import __studioImage2ced6fd8 from "../assets/40c0d325738b1f63.webp";
import * as React from "react"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
import savings from "../../fx/spots/savings"
import community from "../../fx/spots/community"
import chart from "../../fx/spots/chart"
import { SpeakerGrid4, type DeckSpeaker, type DeckDay } from "../speaker-grid-4"
type State = "default" | "hover" | "active" | "disabled" | "error"
export const states = ["default", "hover", "active", "disabled", "error"]
const RENEE = __studioImage49e7652b
const DEV = __studioImage2ad62221
const JUNE = __studioImage2ced6fd8
const DAYS: DeckDay[] = [
{ id: "fri", label: "Day 1 · Friday" },
{ id: "sat", label: "Day 2 · Saturday" },
]
export default function SpeakerGrid4Specimen({ state = "default" }: { state?: State }) {
const s = defaults.sample
const speakers: DeckSpeaker[] = [
{
name: "Renee Calloway",
credential: "Owner, Calloway Home & Hearth",
talk: "Why your front table outsells your website, and how to restock it in ten minutes.",
day: "fri",
photo: slot("presenter", RENEE),
},
{
name: "Dev Okafor",
credential: "Owner, Okafor Hardware & Supply",
talk: "How to win back the customers who started buying online, without matching a single price.",
day: "fri",
photo: DEV,
},
{
name: "Tomás Rivera",
credential: "Buyer, Rivera Gift Co.",
talk: "The pricing mistake that quietly eats your margin, and the one-line fix on your tags.",
day: "fri",
art: savings,
},
{
name: "June Park",
credential: "Owner, Park Street Paper Goods",
talk: "How to run a Saturday event that fills your shop and your email list in one afternoon.",
day: "sat",
photo: JUNE,
},
{
name: "Ada Whitfield",
credential: "Owner, The Yarn Loft",
talk: "The loyalty card trick that brings your regulars back every two weeks.",
day: "sat",
art: community,
},
{
name: "Sam Hollis",
credential: "Owner, Hollis Outfitters",
talk: "What to track on one sheet of paper so you know which shelf pays the rent.",
day: "sat",
art: chart,
},
]
return (
<SpeakerGrid4
headline="Six shop owners. Six reasons to be in the room."
lead="Main Street Makers Live is two days of talks from people who run shops like yours. Flip through the line-up, then grab your ticket."
speakers={speakers}
days={DAYS}
initialIndex={1}
reasonsHeadline={`Three reasons this is ${s.price} today`}
reasons={[
"One ticket covers both days of talks.",
"Every talk ends with a plan you can use on Monday.",
`You get the full ${s.regularPrice} ticket for less than half.`,
]}
regularPrice={s.regularPrice}
price={s.price}
priceNote="per ticket · both days"
commitLabel={`I understand I'm covered by the ${s.guarantee}.`}
ctaLabel={`Get My Ticket For ${s.price}`}
ctaNote="Secure checkout · E-ticket by email"
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalSpeakerGrid4 |
React.ReactNode |
|
lead OptionalSpeakerGrid4 |
React.ReactNode |
|
speakers OptionalSpeakerGrid4 |
DeckSpeaker[] |
|
days OptionalSpeakerGrid4 |
DeckDay[] |
|
initialIndex OptionalSpeakerGrid4 |
number |
|
reasonsHeadline OptionalSpeakerGrid4 |
React.ReactNode |
|
reasons OptionalSpeakerGrid4 |
React.ReactNode[] |
|
regularPrice OptionalSpeakerGrid4 |
string |
|
price OptionalSpeakerGrid4 |
string |
|
priceNote OptionalSpeakerGrid4 |
string |
|
commitLabel OptionalSpeakerGrid4 |
React.ReactNode |
|
commitDefault OptionalSpeakerGrid4 |
boolean |
|
ctaLabel OptionalSpeakerGrid4 |
string |
|
ctaNote OptionalSpeakerGrid4 |
string |
|
href OptionalSpeakerGrid4 |
string |
|
onAction OptionalSpeakerGrid4 |
() => void |
|
disabled OptionalSpeakerGrid4 |
boolean |
|
copy OptionalSpeakerGrid4 |
Partial<SpeakerGrid4Copy> |
|
state OptionalSpeakerGrid4 |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalSpeakerGrid4 |
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-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- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter- A photo of the host, coach or founder.
-
369bb6f216bb84ab.webp
image/webp · 22.6 KB
-
40c0d325738b1f63.webp
image/webp · 53.9 KB
-
5602e47ebdb81810.webp
image/webp · 35.6 KB
-
87170e25e6a4d825.webp
image/webp · 18.7 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
d5100d8143495aeb.webp
image/webp · 66.8 KB
-
e298de079d15a65c.webp
image/webp · 65.4 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB