Challenge Days 1
Shows the free challenge day by day, spotlighting what each day delivers, then asks the reader to save a seat.
Use it in a prompt
Use content/challenge-days 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/challenge-days.tsx. - Import it and pass your copy and images (Props tab):
import { ChallengeDays } from "@/components/funneldna/content/challenge-days"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/challenge-days/component.tsx 439 lines
// Shows the free challenge day by day, spotlighting what each day delivers, then asks the reader to save a seat.
// layout: spotlight-row
"use client"
import * as React from "react"
import { AlertCircle, CalendarClock, ChevronDown, Clock, Flag, Loader2, PackageCheck } from "lucide-react"
/**
* Challenge Days: the day-by-day of a free challenge that sells showing up.
* One day sits in the spotlight (its promise, the one thing you leave with, the live time)
* above a row of day tabs. A rising step meter builds toward the payoff day, and the
* save-my-seat button closes the piece. Works for 3 to 7 days.
* On narrow containers the tabs stack and the spotlight opens directly under the chosen day.
* Every colour, face, button and card reads the theme tokens; hex appears only as a var() fallback.
* Clicking never sends data: the page passes onAction/onSave (or href).
*/
export type ChallengeDay = {
/** What changes for the visitor that day, as a short promise headline. */
title: string
/** One line on what they do that day. */
promise: string
/** The one thing they leave with. */
leaveWith: string
/** Live date/time string, e.g. "Mon · 12:00 PM ET". Omit when not set. */
time?: string
}
export type ChallengeDaysLabels = {
day: string
dayOf: string
payoff: string
buildsTo: string
payoffNote: string
leaveWith: string
live: string
saving: string
/** @deprecated No longer rendered. */
firstSession: string
}
/** "success" is accepted for older callers and renders as default. */
export type ChallengeDaysState = "default" | "hover" | "active" | "disabled" | "error" | "success"
export type ChallengeDaysProps = {
heading?: string
/** A phrase inside the heading, set in the accent colour. */
highlight?: string
subheading?: string
days?: ChallengeDay[]
/** Day shown in the spotlight first (0-based). Defaults to the payoff day. */
initialDay?: number
ctaLabel?: string
/** One short reassurance line under the button. */
ctaNote?: string
/** Navigation destination; the button renders as a link when set. */
href?: string
/** Called on click. A returned promise shows the saving label; a rejection shows errorText. */
onAction?: () => void | Promise<void>
/** Legacy alias for onAction. */
onSave?: () => void | Promise<void>
/** @deprecated No longer rendered: the builder wires what happens after the click. */
successText?: string
errorText?: string
labels?: Partial<ChallengeDaysLabels>
/** Preview state for the studio. */
state?: ChallengeDaysState
className?: string
}
const DEFAULT_LABELS: ChallengeDaysLabels = {
day: "Day {n}",
dayOf: "Day {n} of {total}",
payoff: "The payoff",
buildsTo: "Builds to the Day {total} payoff",
payoffNote: "Everything comes together today",
leaveWith: "You leave with:",
live: "Live:",
saving: "Saving your seat…",
firstSession: "Day 1 · {time}",
}
export const defaultChallengeDays: ChallengeDay[] = [
{ title: "Get clear on your offer", promise: "Pin down who it is for and the one result it promises, in a single sentence.", leaveWith: "Your one-line offer" },
{ title: "Map the pages you need", promise: "Sketch every page from the first click to the checkout, so nothing is guesswork.", leaveWith: "Your funnel page map" },
{ title: "Find the words for your page", promise: "Draft the headline and offer copy that make your page worth reading.", leaveWith: "Your headline and offer copy" },
{ title: "Make the next step clear", promise: "Write the one call to action your visitors see on every page.", leaveWith: "Your call to action" },
{ title: "Know what to check before you launch", promise: "Bring your map and page copy together and check every link, form and step.", leaveWith: "Your launch checklist" },
]
function fill(t: string, vars: Record<string, string | number>) {
return Object.keys(vars).reduce((s, k) => s.split("{" + k + "}").join(String(vars[k])), t)
}
function Heading({ text, highlight }: { text: string; highlight?: string }) {
const at = highlight ? text.indexOf(highlight) : -1
if (!highlight || at < 0) return <>{text}</>
return (
<>
{text.slice(0, at)}
<span className="cfcd-hl">{highlight}</span>
{text.slice(at + highlight.length)}
</>
)
}
const SH = "var(--shadow, oklch(0.22 0.03 260))"
const SHADOW_SM = `var(--shadow-sm, 0 1px 2px oklch(from ${SH} l c h / 0.2), 0 1px 3px oklch(from ${SH} l c h / 0.14))`
const SHADOW_MD = `var(--shadow-md, 0 1px 2px oklch(from ${SH} l c h / 0.22), 0 4px 10px -2px oklch(from ${SH} l c h / 0.2))`
const SHADOW_LG = `var(--shadow-lg, 0 2px 4px oklch(from ${SH} l c h / 0.22), 0 12px 24px -8px oklch(from ${SH} l c h / 0.32))`
const DISPLAY = "var(--font-display, var(--font-body, system-ui, sans-serif))"
const wide = (s: string) => `
${s} { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 1rem; }
${s} > .cfcd-spot { grid-column: 1 / -1; order: -1; margin-bottom: 0.625rem; }
${s} > .cfcd-tile { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; padding: 1.1rem 1.15rem 1.15rem; }
${s} .cfcd-chev { display: none; }
${s} .cfcd-time { align-self: end; margin-top: 0.75rem; }
${s} > .cfcd-tile[aria-expanded='true']::before { content: ''; position: absolute; top: -0.5625rem; left: 50%; width: 1rem; height: 1rem; background: var(--cfcd-pick); border-top: 1px solid var(--cfcd-pick-line); border-left: 1px solid var(--cfcd-pick-line); border-top-left-radius: 3px; transform: translateX(-50%) rotate(45deg); }
`
const CSS = `
.cfcd {
--cfcd-r: var(--card-radius, var(--radius, 14px));
--cfcd-line: var(--card-border, oklch(from var(--ink, #101828) l c h / 0.14));
--cfcd-quiet: color-mix(in oklch, var(--ink, #101828) 4.5%, var(--card, #ffffff));
--cfcd-pick: color-mix(in oklch, var(--accent-fill, var(--accent, #2563eb)) 9%, var(--card, #ffffff));
--cfcd-pick-line: color-mix(in oklch, var(--accent-fill, var(--accent, #2563eb)) 48%, var(--card, #ffffff));
container: cfcd / inline-size;
width: 100%;
max-width: 74rem;
margin-inline: auto;
color: var(--ink, #101828);
font-family: var(--font-body, system-ui, sans-serif);
-webkit-font-smoothing: antialiased;
}
.cfcd *, .cfcd *::before, .cfcd *::after { box-sizing: border-box; }
.cfcd :where(h2, h3, p) { margin: 0; }
.cfcd-head { text-align: center; margin-bottom: clamp(1.5rem, 4cqi, 2.5rem); }
.cfcd-h { font-family: ${DISPLAY}; font-weight: var(--display-weight, 800); text-transform: var(--display-case, none); letter-spacing: var(--display-tracking, -0.03em); font-size: clamp(2rem, 1.2rem + 4cqi, 3.75rem); line-height: 1.04; text-wrap: balance; color: var(--ink, #101828); }
.cfcd-hl { color: var(--accent, #2563eb); }
.cfcd-sub { max-width: 40rem; margin: 1.1rem auto 0; font-size: clamp(1.0625rem, 1rem + 0.5cqi, 1.3125rem); font-weight: 500; line-height: 1.45; color: var(--muted, #475467); text-wrap: pretty; }
.cfcd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
.cfcd-tile { position: relative; order: calc(var(--i) * 2); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; column-gap: 0.75rem; row-gap: 0.3rem; width: 100%; min-height: 3rem; margin: 0; padding: 0.95rem 1.05rem; border: 1px solid var(--cfcd-line); border-radius: var(--cfcd-r); background: var(--card, #ffffff); color: var(--ink, #101828); font: inherit; text-align: left; cursor: pointer; box-shadow: ${SHADOW_SM}; -webkit-tap-highlight-color: transparent; transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease; }
.cfcd-tile > :not(.cfcd-chev) { grid-column: 1; min-width: 0; }
.cfcd-day { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 800; letter-spacing: 0.06em; line-height: 1.25; text-transform: uppercase; color: var(--muted, #475467); }
.cfcd-day svg { width: 1em; height: 1em; flex: none; color: var(--accent, #2563eb); }
.cfcd-ttl { font-family: ${DISPLAY}; font-weight: var(--display-weight, 800); text-transform: var(--display-case, none); font-size: 1.125rem; line-height: 1.2; letter-spacing: -0.012em; text-wrap: balance; }
.cfcd-time { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9375rem; line-height: 1.3; color: var(--muted, #475467); }
.cfcd-time svg { width: 1rem; height: 1rem; flex: none; }
.cfcd-chev { grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 1.25rem; height: 1.25rem; color: var(--muted, #475467); transition: transform 0.2s ease; }
.cfcd-tile[aria-expanded='true'] { background: var(--cfcd-pick); border-color: var(--cfcd-pick-line); box-shadow: ${SHADOW_MD}; }
.cfcd-tile[aria-expanded='true'] :is(.cfcd-day, .cfcd-time) { color: var(--ink, #101828); }
.cfcd-tile[aria-expanded='true'] .cfcd-chev { transform: rotate(180deg); color: var(--accent, #2563eb); }
@media (hover: hover) {
.cfcd-tile:hover { transform: translateY(-2px); box-shadow: ${SHADOW_MD}; }
.cfcd-tile:not([aria-expanded='true']):hover { border-color: oklch(from var(--ink, #101828) l c h / 0.28); }
}
.cfcd-tile:active { transform: translateY(0) scale(0.99); }
.cfcd-tile:focus-visible { outline: 3px solid var(--accent, #2563eb); outline-offset: 3px; }
.cfcd-spot { order: var(--spot-order, -1); display: grid; gap: 0.875rem; padding: 0.75rem; border: 1.5px solid var(--cfcd-pick-line); border-radius: calc(var(--cfcd-r) * 1.35); background: var(--card, #ffffff); box-shadow: inset 0 0 0 1px oklch(from var(--card, #ffffff) calc(l + 0.04) c h / 0.6), ${SHADOW_LG}; }
.cfcd-panel { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1.05rem; border-radius: var(--cfcd-r); background: var(--cfcd-pick); }
.cfcd-num { flex: none; font-family: ${DISPLAY}; font-weight: var(--display-weight, 800); font-size: 3.25rem; line-height: 0.82; letter-spacing: -0.06em; font-variant-numeric: tabular-nums lining-nums; color: var(--accent, #2563eb); transform-origin: left bottom; padding-right: 0.06em; }
.cfcd-meter { flex: 1; min-width: 0; display: grid; gap: 0.5rem; }
.cfcd-steps { display: flex; align-items: flex-end; gap: 0.25rem; height: 2.25rem; }
.cfcd-step { flex: 1 1 0; min-width: 0; height: var(--h); border-radius: 0.3rem 0.3rem 0.15rem 0.15rem; background: oklch(from var(--ink, #101828) l c h / 0.14); transition: background-color 0.3s ease, height 0.3s ease; }
.cfcd-step.is-on { background: linear-gradient(oklch(from var(--accent-fill, var(--accent, #2563eb)) calc(l + 0.05) c h), oklch(from var(--accent-fill, var(--accent, #2563eb)) calc(l - 0.05) c h)); }
.cfcd-flag { flex: none; align-self: flex-start; width: 1.25rem; height: 1.25rem; margin-left: 0.2rem; color: var(--accent, #2563eb); }
.cfcd-cap { font-size: 0.875rem; font-weight: 700; line-height: 1.3; color: var(--ink, #101828); text-wrap: pretty; }
.cfcd-body { min-width: 0; padding: 0.25rem 0.35rem 0.4rem; }
.cfcd-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.875rem; }
.cfcd-tag { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.375rem 0.8rem; border-radius: 999px; background: var(--cfcd-quiet); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.05em; line-height: 1.2; text-transform: uppercase; color: var(--ink, #101828); }
.cfcd-tag svg { width: 1rem; height: 1rem; flex: none; color: var(--accent, #2563eb); }
.cfcd-tag.is-payoff { background: color-mix(in oklch, var(--accent-fill, var(--accent, #2563eb)) 12%, var(--card, #ffffff)); }
.cfcd-title { font-family: ${DISPLAY}; font-weight: var(--display-weight, 800); text-transform: var(--display-case, none); letter-spacing: var(--display-tracking, -0.025em); font-size: clamp(1.5rem, 1.05rem + 2.4cqi, 2.375rem); line-height: 1.08; text-wrap: balance; color: var(--ink, #101828); }
.cfcd-promise { max-width: 40rem; margin-top: 0.7rem; font-size: clamp(1.0625rem, 1rem + 0.35cqi, 1.25rem); line-height: 1.5; color: var(--muted, #475467); text-wrap: pretty; }
.cfcd-facts { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.25rem; }
.cfcd-fact { display: flex; align-items: center; gap: 0.65rem; min-width: 0; padding: 0.75rem 1rem; border-radius: var(--cfcd-r); background: var(--cfcd-quiet); font-size: 1rem; line-height: 1.35; color: var(--ink, #101828); text-wrap: pretty; }
.cfcd-fact svg { flex: none; width: 1.25rem; height: 1.25rem; color: var(--accent, #2563eb); }
.cfcd-fact b { font-weight: 800; }
.cfcd-anim { animation: cfcd-in 0.38s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.cfcd-anim-num { animation: cfcd-num 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes cfcd-in { from { opacity: 0.4; transform: translateY(6px); } }
@keyframes cfcd-num { from { opacity: 0.3; transform: translateY(0.12em) scale(0.94); } }
@keyframes cfcd-spin { to { transform: rotate(360deg); } }
.cfcd-cta { display: grid; justify-items: center; gap: 0.75rem; margin-top: clamp(1.75rem, 4cqi, 2.75rem); text-align: center; }
.cfcd-btn { --b: var(--button-bg, var(--cta, #dc2626)); display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; max-width: 30rem; min-height: 4rem; margin: 0; padding: 1rem 1.5rem; border: 1px solid oklch(from var(--b) calc(l - 0.1) c h); border-radius: var(--button-radius, var(--radius, 12px)); background: linear-gradient(oklch(from var(--b) calc(l + 0.05) c h), var(--button-bg-2, oklch(from var(--b) calc(l - 0.06) c h))); color: var(--button-ink, var(--cta-ink, #ffffff)); font-family: var(--button-font, ${DISPLAY}); font-weight: var(--button-weight, 800); text-transform: var(--button-case, none); font-size: clamp(1.25rem, 1.05rem + 1.1cqi, 1.625rem); letter-spacing: -0.01em; line-height: 1.15; text-align: center; text-decoration: none; text-shadow: var(--button-text-shadow, none); text-wrap: balance; cursor: pointer; box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.16) c h), 0 1px 2px oklch(from ${SH} l c h / 0.3), 0 8px 16px -6px oklch(from ${SH} l c h / 0.45)); transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.cfcd-btn svg { width: 1.2em; height: 1.2em; flex: none; }
.cfcd-btn:not(:disabled):hover, .cfcd-btn[data-force='hover'] { transform: translateY(-2px); background: linear-gradient(oklch(from var(--b) calc(l + 0.02) c h), oklch(from var(--b) calc(l - 0.09) c h)); box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.18) c h), 0 2px 3px oklch(from ${SH} l c h / 0.32), 0 12px 20px -8px oklch(from ${SH} l c h / 0.5)); }
.cfcd-btn:not(:disabled):active, .cfcd-btn[data-force='active'] { transform: translateY(1px); background: linear-gradient(oklch(from var(--b) calc(l - 0.04) c h), oklch(from var(--b) calc(l - 0.1) c h)); box-shadow: inset 0 2px 3px oklch(from var(--b) calc(l - 0.22) c h / 0.55), 0 1px 2px oklch(from ${SH} l c h / 0.3); }
.cfcd-btn:focus-visible { outline: 3px solid var(--accent, #2563eb); outline-offset: 3px; }
.cfcd-btn:disabled:not([aria-busy='true']) { border-color: transparent; background: var(--button-2-bg, var(--secondary, #e8ebf1)); color: var(--button-2-ink, var(--secondary-ink, #101828)); text-shadow: none; cursor: not-allowed; box-shadow: var(--button-2-shadow, var(--shadow-sm)); }
.cfcd-btn[aria-busy='true'] { cursor: progress; }
.cfcd-spin { animation: cfcd-spin 0.9s linear infinite; }
.cfcd-note { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--muted, #475467); text-wrap: pretty; }
.cfcd-err { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; font-weight: 700; line-height: 1.4; color: var(--danger, #b42318); text-wrap: pretty; }
.cfcd-err svg { width: 1.15rem; height: 1.15rem; flex: none; }
@container cfcd (min-width: 640px) {
.cfcd .cfcd-spot { grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr); gap: 1.75rem; padding: 0.875rem; }
.cfcd .cfcd-panel { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 1.5rem; padding: 1.5rem 1.4rem 1.3rem; }
.cfcd .cfcd-num { font-size: clamp(5.5rem, 2.5rem + 7.5cqi, 8.75rem); }
.cfcd .cfcd-steps { height: 3rem; }
.cfcd .cfcd-body { align-self: start; padding: 1.4rem 1.5rem 1.4rem 0; }
}
@container cfcd (min-width: 760px) {
${wide(".cfcd .cfcd-grid:is([data-count='3'], [data-count='4'], [data-count='5'])")}
}
@container cfcd (min-width: 1000px) {
${wide(".cfcd .cfcd-grid:is([data-count='6'], [data-count='7'])")}
}
@media (prefers-reduced-motion: reduce) {
.cfcd *, .cfcd *::before, .cfcd *::after { animation: none !important; transition: none !important; }
.cfcd .cfcd-tile:hover, .cfcd .cfcd-btn:hover, .cfcd .cfcd-btn[data-force='hover'] { transform: none; }
}
`
export function ChallengeDays({
heading,
highlight,
subheading,
days = defaultChallengeDays,
initialDay,
ctaLabel = "Yes! Save My Seat",
ctaNote = "Free challenge · Join online",
href,
onAction,
onSave,
errorText = "We couldn’t save your seat. Please try again.",
labels: labelOverrides,
state = "default",
className,
}: ChallengeDaysProps) {
const L = { ...DEFAULT_LABELS, ...labelOverrides }
const n = days.length
const payoffIndex = Math.max(n - 1, 0)
const [active, setActive] = React.useState(() => Math.min(Math.max(initialDay ?? payoffIndex, 0), payoffIndex))
const [status, setStatus] = React.useState<"idle" | "loading" | "error">("idle")
const tileRefs = React.useRef<Array<HTMLButtonElement | null>>([])
const uid = React.useId()
const spotId = `${uid}-spot`
const titleId = `${uid}-title`
if (n === 0) return null
const current = Math.min(active, payoffIndex)
const day = days[current]
const isPayoff = current === payoffIndex
const shown = state === "error" ? "error" : status
const disabled = state === "disabled" || shown === "loading"
const force = state === "hover" || state === "active" ? state : undefined
const save = async () => {
const action = onAction ?? onSave
if (!action || disabled) return
try {
const result = action()
if (!result) return
setStatus("loading")
await result
setStatus("idle")
} catch {
setStatus("error")
}
}
const onKey = (e: React.KeyboardEvent<HTMLButtonElement>, i: number) => {
let j = -1
if (e.key === "ArrowRight" || e.key === "ArrowDown") j = (i + 1) % n
else if (e.key === "ArrowLeft" || e.key === "ArrowUp") j = (i - 1 + n) % n
else if (e.key === "Home") j = 0
else if (e.key === "End") j = n - 1
if (j < 0) return
e.preventDefault()
setActive(j)
tileRefs.current[j]?.focus()
}
const buttonInner =
shown === "loading" ? (
<>
<Loader2 className="cfcd-spin" aria-hidden="true" />
<span>{L.saving}</span>
</>
) : (
<span>{ctaLabel}</span>
)
return (
<div className={["cfcd", className].filter(Boolean).join(" ")}>
<style>{CSS}</style>
{(heading || subheading) && (
<header className="cfcd-head">
{heading && (
<h2 className="cfcd-h">
<Heading text={heading} highlight={highlight} />
</h2>
)}
{subheading && <p className="cfcd-sub">{subheading}</p>}
</header>
)}
<div
className="cfcd-grid"
data-count={Math.min(Math.max(n, 3), 7)}
style={{ ["--n" as string]: n } as React.CSSProperties}
>
<section
className="cfcd-spot"
id={spotId}
aria-labelledby={titleId}
style={{ ["--spot-order" as string]: current * 2 + 1 } as React.CSSProperties}
>
<div className="cfcd-panel">
<span key={`num-${current}`} className="cfcd-num cfcd-anim-num" aria-hidden="true">
{String(current + 1).padStart(2, "0")}
</span>
<div className="cfcd-meter">
<div className="cfcd-steps" aria-hidden="true">
{days.map((_, i) => (
<span
key={i}
className={`cfcd-step${i <= current ? " is-on" : ""}`}
style={{ ["--h" as string]: `${28 + Math.round((72 * i) / Math.max(n - 1, 1))}%` } as React.CSSProperties}
/>
))}
<Flag className="cfcd-flag" />
</div>
<p className="cfcd-cap">{isPayoff ? L.payoffNote : fill(L.buildsTo, { total: n })}</p>
</div>
</div>
<div key={`body-${current}`} className="cfcd-body cfcd-anim">
<div className="cfcd-tags">
<span className="cfcd-tag">{fill(L.dayOf, { n: current + 1, total: n })}</span>
{isPayoff && (
<span className="cfcd-tag is-payoff">
<Flag aria-hidden="true" />
{L.payoff}
</span>
)}
</div>
<h3 id={titleId} className="cfcd-title">
{day.title}
</h3>
<p className="cfcd-promise">{day.promise}</p>
<div className="cfcd-facts">
<p className="cfcd-fact">
<PackageCheck aria-hidden="true" />
<span>
<b>{L.leaveWith}</b> {day.leaveWith}
</span>
</p>
{day.time && (
<p className="cfcd-fact">
<CalendarClock aria-hidden="true" />
<span>
<b>{L.live}</b> {day.time}
</span>
</p>
)}
</div>
</div>
</section>
{days.map((d, i) => {
const pay = i === payoffIndex
return (
<button
key={i}
ref={(el) => {
tileRefs.current[i] = el
}}
type="button"
className={`cfcd-tile${pay ? " is-payoff" : ""}`}
aria-expanded={i === current}
aria-controls={spotId}
onClick={() => setActive(i)}
onKeyDown={(e) => onKey(e, i)}
style={{ ["--i" as string]: i } as React.CSSProperties}
>
<span className="cfcd-day">
{pay && <Flag aria-hidden="true" />}
{fill(L.day, { n: i + 1 })}
{pay && <span>· {L.payoff}</span>}
</span>
<span className="cfcd-ttl">{d.title}</span>
{d.time && (
<span className="cfcd-time">
<Clock aria-hidden="true" />
{d.time}
</span>
)}
<ChevronDown className="cfcd-chev" aria-hidden="true" />
</button>
)
})}
</div>
<div className="cfcd-cta">
<>
{href && state !== "disabled" ? (
<a className="cfcd-btn" href={href} data-force={force} aria-busy={shown === "loading" || undefined} onClick={save}>
{buttonInner}
</a>
) : (
<button
type="button"
className="cfcd-btn"
disabled={disabled}
aria-busy={shown === "loading" || undefined}
data-force={force}
onClick={save}
>
{buttonInner}
</button>
)}
{ctaNote && <p className="cfcd-note">{ctaNote}</p>}
{shown === "error" && (
<p className="cfcd-err" role="alert">
<AlertCircle aria-hidden="true" />
<span>{errorText}</span>
</p>
)}
</>
</div>
</div>
)
}
export default ChallengeDays
pieces/content/challenge-days/specimen.tsx 55 lines
import * as React from "react"
import { ChallengeDays, type ChallengeDay, type ChallengeDaysState } from "../challenge-days"
import defaults from "../../studio-defaults.json"
export const states = ["default", "hover", "active", "disabled", "error"]
const days: ChallengeDay[] = [
{
title: "Get clear on your offer",
promise: "Pin down who it is for and the one result it promises, in a single sentence.",
leaveWith: "Your one-line offer",
time: "Mon · 12:00 PM ET",
},
{
title: "Map the pages you need",
promise: "Sketch every page from the first click to the checkout, so nothing is guesswork.",
leaveWith: "Your funnel page map",
time: "Tue · 12:00 PM ET",
},
{
title: "Find the words for your page",
promise: "Draft the headline and offer copy that make your page worth reading.",
leaveWith: "Your headline and offer copy",
time: "Wed · 12:00 PM ET",
},
{
title: "Make the next step clear",
promise: "Write the one call to action your visitors see on every page.",
leaveWith: "Your call to action",
time: "Thu · 12:00 PM ET",
},
{
title: "Know what to check before you launch",
promise: "Bring your map and page copy together and check every link, form and step.",
leaveWith: "Your launch checklist",
time: "Fri · 12:00 PM ET",
},
]
export default function ChallengeDaysSpecimen({ state = "default" }: { state?: string }) {
const sample = defaults.sample
const reg = sample.registration
return (
<ChallengeDays
heading={sample.headline}
highlight="first funnel"
subheading="Five focused days. One clear next step at a time."
days={days}
ctaLabel={reg.label}
ctaNote={reg.sublabel}
errorText={reg.error}
state={state as ChallengeDaysState}
/>
)
}
| Name | Type | Details |
|---|---|---|
heading OptionalChallengeDays |
string |
|
highlight OptionalChallengeDays |
string |
|
subheading OptionalChallengeDays |
string |
|
days OptionalChallengeDays |
ChallengeDay[] |
Default defaultChallengeDays
|
initialDay OptionalChallengeDays |
number |
|
ctaLabel OptionalChallengeDays |
string |
Default "Yes! Save My Seat"
|
ctaNote OptionalChallengeDays |
string |
Default "Free challenge · Join online"
|
href OptionalChallengeDays |
string |
|
onAction OptionalChallengeDays |
() => void | Promise<void> |
|
onSave OptionalChallengeDays |
() => void | Promise<void> |
|
successText OptionalChallengeDays |
string |
|
errorText OptionalChallengeDays |
string |
Default "We couldn’t save your seat. Please try again."
|
labels OptionalChallengeDays |
Partial<ChallengeDaysLabels> |
|
state OptionalChallengeDays |
ChallengeDaysState |
Default "default"
|
className OptionalChallengeDays |
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- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB