FAQ Index 1
FAQ Index: clears every buying question in a clean, filterable index, with the price receipt and the next step pinned beside it, so each answer leads straight to the click.
Use it in a prompt
Use content/faq-index 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/faq-index.tsx. - Import it and pass your copy and images (Props tab):
import { FaqIndex } from "@/components/funneldna/content/faq-index"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/faq-index/component.tsx 531 lines
// layout: bento-grid
// FAQ Index: clears every buying question in a clean, filterable index, with the price receipt and the next step pinned beside it, so each answer leads straight to the click.
import React from "react";
import { ShieldCheck } from "lucide-react";
import { Divider, Pattern, FX_HOST } from "../fx/fx";
export type FaqIndexItem = {
question: string;
answer: React.ReactNode;
/** Topic id matching topics[].id; drives the filter chips and the selling subheads */
topic?: string;
};
export type FaqIndexTopic = {
id: string;
/** Short chip label, e.g. "delivery" */
label: string;
/** Selling subhead printed above this topic's questions */
headline?: React.ReactNode;
};
export type FaqIndexReceiptLine = {
label: string;
value: string;
/** "item" (default), "subtotal" (bold) or "discount" (savings colour) */
kind?: "item" | "subtotal" | "discount";
};
export type FaqIndexProps = {
headline?: React.ReactNode;
/** Phrase after the headline, set in the accent colour */
emphasis?: React.ReactNode;
lead?: React.ReactNode;
items?: FaqIndexItem[];
/** Two to four topics show filter chips; topics with headlines also group the list */
topics?: FaqIndexTopic[];
allLabel?: string;
/** Accessible name of the chip group */
filterLabel?: string;
/** Screen-reader note after filtering; {count} is replaced with the number shown */
resultsLabel?: string;
/** Indexes (into items) of questions open on load */
defaultOpen?: number[];
/** Set questions in lower case, index style */
lowercase?: boolean;
/** scene slot: photo behind the action tile */
sceneImage?: string;
sceneImageAlt?: string;
/** The question the button answers */
ctaQuestion?: React.ReactNode;
ctaLabel?: string;
ctaNote?: React.ReactNode;
href?: string;
onAction?: () => void;
disabled?: boolean;
receiptTitle?: React.ReactNode;
receiptLines?: FaqIndexReceiptLine[];
totalLabel?: string;
total?: string;
receiptNote?: React.ReactNode;
state?: "default" | "hover" | "disabled";
className?: string;
};
const DEFAULT_ITEMS: FaqIndexItem[] = [
{ question: "what's inside the funnel starter kit?", answer: "The Funnel Planning Guide, the Page Copy Workbook and the Launch Checklist, all in one download." },
{ question: "how fast do i get it?", answer: "Instantly. Your download is ready the moment checkout is done." },
{ question: "is this a monthly subscription?", answer: "No. You make one payment and keep lifetime access." },
{ question: "do i need my offer figured out first?", answer: "No. The planning guide starts there: you map your offer and the pages your funnel needs." },
{ question: "will it help me write the page itself?", answer: "Yes. The Page Copy Workbook walks you through your headline, your offer and your call to action." },
{ question: "what if it isn't right for me?", answer: "You're covered by a 30-day money-back guarantee." },
];
const DEFAULT_RECEIPT: FaqIndexReceiptLine[] = [
{ label: "Funnel Planning Guide", value: "$49" },
{ label: "Page Copy Workbook", value: "$29" },
{ label: "Launch Checklist", value: "$19" },
{ label: "Subtotal", value: "$97", kind: "subtotal" },
{ label: "Bundle discount", value: "−$50", kind: "discount" },
];
type Row = { item: FaqIndexItem; index: number };
type Group = { key: string; headline?: React.ReactNode; rows: Row[] };
export function FaqIndex(props: FaqIndexProps) {
const {
headline = "Quick answers before you",
emphasis = "build your first funnel",
lead = "Short, straight answers. Then get back to building.",
items = DEFAULT_ITEMS,
topics = [],
allLabel = "all",
filterLabel = "Filter questions by topic",
resultsLabel = "{count} questions shown",
defaultOpen = [0],
lowercase = true,
sceneImage,
sceneImageAlt = "",
ctaQuestion = "Ready to map your first funnel?",
ctaLabel = "I'm ready, show me how",
ctaNote = "Secure checkout · Instant download",
href,
onAction,
disabled = false,
receiptTitle = "All three tools, one payment",
receiptLines = DEFAULT_RECEIPT,
totalLabel = "Today",
total = "$47",
receiptNote = "30-day money-back guarantee",
state = "default",
className,
} = props;
const uid = "fi" + React.useId().replace(/[^a-zA-Z0-9_-]/g, "");
const [open, setOpen] = React.useState<Set<number>>(() => new Set(defaultOpen));
const [filter, setFilter] = React.useState("all");
const live = topics.filter((t) => items.some((it) => it.topic === t.id));
const showChips = live.length >= 2;
const active = showChips && live.some((t) => t.id === filter) ? filter : "all";
const indexed: Row[] = items.map((item, index) => ({ item, index }));
let groups: Group[];
if (live.length) {
const shown = active === "all" ? live : live.filter((t) => t.id === active);
groups = shown.map((t) => ({ key: t.id, headline: t.headline, rows: indexed.filter((r) => r.item.topic === t.id) }));
if (active === "all") {
const loose = indexed.filter((r) => !live.some((t) => t.id === r.item.topic));
if (loose.length) groups.push({ key: "__rest", rows: loose });
}
} else {
groups = [{ key: "__all", rows: indexed }];
}
const grouped = groups.some((g) => g.headline);
const QH = (grouped ? "h4" : "h3") as "h3" | "h4";
const shownCount = groups.reduce((n, g) => n + g.rows.length, 0);
const toggle = (i: number) =>
setOpen((prev) => {
const next = new Set(prev);
if (next.has(i)) next.delete(i);
else next.add(i);
return next;
});
const hasReceipt = receiptLines.length > 0 || Boolean(total);
const hasCta = Boolean(ctaLabel);
const hasAside = hasReceipt || hasCta;
const isDisabled = disabled || state === "disabled";
const btnClass = "fi-btn" + (state === "hover" ? " is-hover" : "");
let order = 0;
return (
<section
className={"cf-faq-index" + (className ? " " + className : "")}
style={{ ...FX_HOST, overflow: "clip" }}
aria-labelledby={uid + "-h"}
>
<style>{CSS}</style>
<Pattern name="grid" fade="edges" />
<Divider shape="curve" tone="surface" height={56} />
<div className="fi-wrap">
<div className={"fi-bento" + (hasAside ? "" : " fi-bento--solo")}>
<div className="fi-card fi-index">
<div className="fi-head">
<h2 id={uid + "-h"} className="fi-h2">
{headline}
{emphasis ? (
<>
{" "}
<span className="fi-em">{emphasis}</span>
</>
) : null}
</h2>
{lead ? <p className="fi-lead">{lead}</p> : null}
</div>
{showChips ? (
<div className="fi-chips" role="group" aria-label={filterLabel}>
{[{ id: "all", label: allLabel }, ...live].map((t) => {
const count = t.id === "all" ? items.length : items.filter((it) => it.topic === t.id).length;
return (
<button
key={t.id}
type="button"
className="fi-chip"
aria-pressed={active === t.id}
onClick={() => setFilter(t.id)}
>
<span>{t.label}</span>
<span className="fi-count">{count}</span>
</button>
);
})}
</div>
) : null}
{showChips ? (
<p className="fi-sr" aria-live="polite">
{resultsLabel.replace("{count}", String(shownCount))}
</p>
) : null}
<div key={active} className={"fi-groups" + (lowercase ? " fi-lower" : "")}>
{groups.map((g) => (
<div className="fi-group" key={g.key}>
{g.headline ? <h3 className="fi-sub">{g.headline}</h3> : null}
<ul className="fi-list">
{g.rows.map(({ item, index }) => {
const pos = order++;
const isOpen = open.has(index);
const qid = uid + "-q" + index;
const pid = uid + "-a" + index;
return (
<li
key={index}
className={"fi-row" + (isOpen ? " is-open" : "") + (state === "hover" && pos === 1 ? " is-hover" : "")}
style={{ "--i": pos } as React.CSSProperties}
>
<QH className="fi-qh">
<button
type="button"
id={qid}
className="fi-q"
aria-expanded={isOpen}
aria-controls={pid}
onClick={() => toggle(index)}
>
<span className="fi-prompt" aria-hidden="true">></span>
<span className="fi-qtext">{item.question}</span>
<span className="fi-tog" aria-hidden="true">
[<span className="fi-sign">{isOpen ? "−" : "+"}</span>]
</span>
</button>
</QH>
<div id={pid} role="region" aria-labelledby={qid} className={"fi-panel" + (isOpen ? " is-open" : "")}>
<div className="fi-panel-in">
<div className="fi-answer">{item.answer}</div>
</div>
</div>
</li>
);
})}
</ul>
</div>
))}
</div>
</div>
{hasAside ? (
<div className={"fi-aside" + (hasReceipt && hasCta ? "" : " fi-aside--single")}>
{hasReceipt ? (
<div className="fi-card fi-receipt">
{receiptTitle ? <h3 className="fi-rtitle">{receiptTitle}</h3> : null}
{receiptLines.length ? (
<dl className="fi-rlines">
{receiptLines.map((line, i) => (
<div key={i} className={"fi-rline" + (line.kind && line.kind !== "item" ? " is-" + line.kind : "")}>
<dt>{line.label}</dt>
<dd>{line.value}</dd>
</div>
))}
</dl>
) : null}
{total ? (
<div className="fi-total">
<span className="fi-total-label">{totalLabel}</span>
<strong className="fi-total-price">{total}</strong>
</div>
) : null}
{receiptNote ? (
<p className="fi-rnote">
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden="true" />
{receiptNote}
</p>
) : null}
</div>
) : null}
{hasCta ? (
<div className={"fi-scene" + (sceneImage ? " has-image" : "")}>
{sceneImage ? (
<>
<img className="fi-scene-img" src={sceneImage} alt={sceneImageAlt} loading="lazy" decoding="async" />
<span className="fi-scrim" aria-hidden="true" />
</>
) : null}
<div className="fi-scene-copy">
{ctaQuestion ? <h3 className="fi-ask">{ctaQuestion}</h3> : null}
{href && !isDisabled ? (
<a className={btnClass} href={href} onClick={onAction ? () => onAction() : undefined}>
{ctaLabel}
</a>
) : (
<button type="button" className={btnClass} disabled={isDisabled} onClick={() => onAction?.()}>
{ctaLabel}
</button>
)}
{ctaNote ? <p className="fi-note">{ctaNote}</p> : null}
</div>
</div>
) : null}
</div>
) : null}
</div>
</div>
</section>
);
}
export default FaqIndex;
const CSS = `
.cf-faq-index{
--fi-line: oklch(from var(--ink) l c h / 0.08);
--fi-hair: oklch(from var(--ink) l c h / 0.12);
--fi-well: color-mix(in oklch, var(--ink) 4%, var(--card));
--fi-focus: oklch(from var(--field-focus, var(--accent)) l c h / 0.55);
--fi-shadow: var(--shadow, oklch(0.22 0.03 260));
--fi-gutter: clamp(16px, 5vw, 48px);
position: relative;
isolation: isolate;
box-sizing: border-box;
padding: clamp(56px, 8vw, 112px) var(--fi-gutter) calc(clamp(64px, 8.5vw, 120px) + 56px);
background: color-mix(in oklch, var(--ink) 3%, var(--surface));
color: var(--ink);
font-family: var(--font-body);
}
.cf-faq-index *, .cf-faq-index *::before, .cf-faq-index *::after{ box-sizing: border-box; }
.cf-faq-index .fi-wrap{ position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.cf-faq-index .fi-bento{ display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(16px, 2vw, 24px); align-items: start; }
.cf-faq-index .fi-bento--solo{ grid-template-columns: minmax(0, 1fr); }
.cf-faq-index .fi-card{
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, var(--shadow-md, 0 1px 2px oklch(from var(--fi-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--fi-shadow) l c h / 0.2)));
}
.cf-faq-index .fi-index{ padding: clamp(20px, 3vw, 32px) clamp(8px, 1.6vw, 20px) clamp(12px, 2vw, 20px); }
.cf-faq-index .fi-head{ padding: 0 12px; }
.cf-faq-index .fi-h2{
margin: 0;
font-family: var(--font-display);
font-size: clamp(2rem, 3.6vw, 3.25rem);
line-height: 1.06;
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.025em);
text-transform: var(--display-case, none);
text-wrap: balance;
color: var(--ink);
}
.cf-faq-index .fi-em{ color: var(--accent); }
.cf-faq-index .fi-lead{ margin: 14px 0 0; max-width: 60ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-faq-index .fi-chips{ display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0 12px; }
.cf-faq-index .fi-chip{
appearance: none; display: inline-flex; align-items: center; gap: 8px;
min-height: 40px; margin: 0; padding: 4px 14px;
border: 1px solid transparent; border-radius: 999px;
background: color-mix(in oklch, var(--ink) 6%, var(--card));
color: var(--ink);
font-family: var(--font-body); font-size: 0.875rem; line-height: 1.2; font-weight: 800;
cursor: pointer;
transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.cf-faq-index .fi-chip:hover{ background: color-mix(in oklch, var(--ink) 10%, var(--card)); }
.cf-faq-index .fi-chip:active{ transform: translateY(1px); }
.cf-faq-index .fi-chip[aria-pressed="true"]{ background: color-mix(in oklch, var(--accent) 12%, var(--card)); border-color: oklch(from var(--accent) l c h / 0.45); }
.cf-faq-index .fi-chip:focus-visible{ outline: 3px solid var(--fi-focus); outline-offset: 2px; }
.cf-faq-index .fi-count{ font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.cf-faq-index .fi-groups{ margin-top: 24px; }
.cf-faq-index .fi-group + .fi-group{ margin-top: 32px; }
.cf-faq-index .fi-sub{
margin: 0 0 8px; padding: 0 12px;
font-family: var(--font-display);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
font-weight: var(--display-weight, 800);
letter-spacing: -0.01em;
text-transform: var(--display-case, none);
color: var(--accent);
text-wrap: balance;
}
.cf-faq-index .fi-list{ list-style: none; margin: 0; padding: 0; }
.cf-faq-index .fi-row{
position: relative;
border-radius: 10px;
transition: background-color .16s ease;
animation: fi-rise .45s cubic-bezier(.2,.7,.2,1) both;
animation-delay: min(calc(var(--i, 0) * .07s), .28s);
}
.cf-faq-index .fi-row::before{ content: ""; position: absolute; top: 0; left: 12px; right: 12px; height: 1px; background: var(--fi-hair); transition: opacity .16s ease; }
.cf-faq-index .fi-row:last-child::after{ content: ""; position: absolute; bottom: 0; left: 12px; right: 12px; height: 1px; background: var(--fi-hair); }
.cf-faq-index .fi-row:hover, .cf-faq-index .fi-row.is-hover{ background: var(--fi-well); }
.cf-faq-index .fi-row:hover::before, .cf-faq-index .fi-row.is-hover::before,
.cf-faq-index .fi-row:hover + .fi-row::before, .cf-faq-index .fi-row.is-hover + .fi-row::before,
.cf-faq-index .fi-row:hover::after, .cf-faq-index .fi-row.is-hover::after{ opacity: 0; }
.cf-faq-index .fi-qh{ margin: 0; font: inherit; }
.cf-faq-index .fi-q{
appearance: none;
display: grid; grid-template-columns: 1.1em minmax(0, 1fr) auto; column-gap: 12px; align-items: start;
width: 100%; min-height: 64px; margin: 0; padding: 20px 12px;
border: 0; border-radius: 10px; background: transparent;
color: var(--ink);
font-family: var(--font-body); font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.4;
text-align: left; cursor: pointer;
}
.cf-faq-index .fi-q:focus-visible{ outline: 3px solid var(--fi-focus); outline-offset: -3px; }
.cf-faq-index .fi-prompt{ font-weight: 800; color: var(--accent); transition: transform .16s ease; }
.cf-faq-index .fi-row:hover .fi-prompt, .cf-faq-index .fi-row.is-hover .fi-prompt{ transform: translateX(2px); }
.cf-faq-index .fi-qtext{ font-weight: 600; text-wrap: pretty; overflow-wrap: anywhere; }
.cf-faq-index .fi-lower .fi-qtext{ text-transform: lowercase; }
.cf-faq-index .fi-row.is-open .fi-qtext{ font-weight: 700; }
.cf-faq-index .fi-tog{ font-size: .875em; line-height: 1.6; font-weight: 700; letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; transition: color .16s ease; }
.cf-faq-index .fi-sign{ display: inline-block; min-width: .7em; text-align: center; color: var(--ink); }
.cf-faq-index .fi-row:hover .fi-tog, .cf-faq-index .fi-row.is-hover .fi-tog{ color: var(--ink); }
.cf-faq-index .fi-row.is-open .fi-sign{ color: var(--accent); }
.cf-faq-index .fi-panel{ display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .28s cubic-bezier(.2,.7,.2,1), visibility 0s linear .28s; }
.cf-faq-index .fi-panel.is-open{ grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .28s cubic-bezier(.2,.7,.2,1), visibility 0s; }
.cf-faq-index .fi-panel-in{ min-height: 0; overflow: hidden; }
.cf-faq-index .fi-answer{
max-width: calc(64ch + 24px + 1.1em);
padding: 0 12px 22px calc(24px + 1.1em);
font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.55;
color: var(--ink);
text-wrap: pretty;
}
.cf-faq-index .fi-answer p{ margin: 0; }
.cf-faq-index .fi-answer p + p{ margin-top: 12px; }
.cf-faq-index .fi-answer a{ color: var(--link, var(--accent)); text-decoration: underline; text-decoration-color: oklch(from var(--link, var(--accent)) l c h / 0.45); text-underline-offset: 0.18em; }
.cf-faq-index .fi-answer a:hover{ color: oklch(from var(--link, var(--accent)) calc(l - 0.08) c h); text-decoration-color: currentColor; }
.cf-faq-index .fi-aside{ display: grid; gap: clamp(16px, 2vw, 24px); }
.cf-faq-index .fi-receipt{ padding: clamp(20px, 3vw, 32px); }
.cf-faq-index .fi-rtitle{
margin: 0 0 12px;
font-family: var(--font-display);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15;
font-weight: var(--display-weight, 800); letter-spacing: -0.01em;
text-transform: var(--display-case, none);
color: var(--ink); text-wrap: balance;
}
.cf-faq-index .fi-rlines{ margin: 0; padding: 0; }
.cf-faq-index .fi-rline{ display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.4; }
.cf-faq-index .fi-rline + .fi-rline{ border-top: 1px solid var(--fi-hair); }
.cf-faq-index .fi-rline dt{ min-width: 0; font-weight: 500; text-wrap: pretty; }
.cf-faq-index .fi-rline dd{ margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-faq-index .fi-rline.is-subtotal dt, .cf-faq-index .fi-rline.is-subtotal dd{ font-weight: 800; }
.cf-faq-index .fi-rline.is-discount dd{ color: var(--success); font-weight: 800; }
.cf-faq-index .fi-total{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: var(--fi-well); }
.cf-faq-index .fi-total-label{ font-size: 0.875rem; line-height: 1.2; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.cf-faq-index .fi-total-price{ font-family: var(--font-display); font-size: clamp(2.5rem, 4.2vw, 3.75rem); line-height: 1; font-weight: var(--display-weight, 800); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.cf-faq-index .fi-rnote{ margin: 16px 0 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--muted); text-wrap: balance; }
.cf-faq-index .fi-rnote svg{ display: inline-block; vertical-align: -0.15em; margin-inline-end: .4em; color: var(--success); }
.cf-faq-index .fi-scene{
position: relative; isolation: isolate; overflow: hidden;
display: flex; flex-direction: column; justify-content: flex-end;
padding: clamp(20px, 3vw, 32px);
border-radius: var(--card-radius, var(--radius, 14px));
background: var(--band); color: var(--band-ink);
box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--fi-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--fi-shadow) l c h / 0.32));
}
.cf-faq-index .fi-scene.has-image{ min-height: 380px; }
.cf-faq-index .fi-scene-img{ position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.cf-faq-index .fi-scrim{ position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, oklch(from var(--band) l c h / 0.96) 0%, oklch(from var(--band) l c h / 0.9) 42%, oklch(from var(--band) l c h / 0.35) 74%, oklch(from var(--band) l c h / 0.04) 100%); }
.cf-faq-index .fi-scene-copy{ position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.cf-faq-index .fi-ask{
margin: 0 0 20px;
font-family: var(--font-display);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem); line-height: 1.15;
font-weight: var(--display-weight, 800); letter-spacing: -0.01em;
text-transform: var(--display-case, none);
color: var(--band-ink); text-wrap: balance;
}
.cf-faq-index .fi-btn{
display: inline-flex; align-items: center; justify-content: center;
width: auto; min-width: min(100%, 280px); max-width: 100%;
min-height: 64px; margin: 0; padding: 12px 28px;
border: 0; border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));
color: var(--button-ink, var(--cta-ink));
font-family: var(--button-font, var(--font-display));
font-size: clamp(1.125rem, 1.55vw, 1.375rem); line-height: 1.15;
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
text-align: center; text-decoration: none; text-wrap: balance;
text-shadow: var(--button-text-shadow, none);
cursor: pointer;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--fi-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--fi-shadow) l c h / 0.45));
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-faq-index .fi-btn:hover:not(:disabled), .cf-faq-index .fi-btn.is-hover{
background: linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));
transform: translateY(-1px);
box-shadow: inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--fi-shadow) l c h / 0.34), 0 10px 18px -6px oklch(from var(--fi-shadow) l c h / 0.55);
}
.cf-faq-index .fi-btn:active:not(:disabled){
transform: translateY(1px);
box-shadow: inset 0 2px 3px oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.2) c h / 0.45), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--fi-shadow) l c h / 0.3);
}
.cf-faq-index .fi-btn:focus-visible{ outline: 3px solid var(--band-ink); outline-offset: 3px; }
.cf-faq-index .fi-btn: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-faq-index .fi-note{ margin: 12px 0 0; text-align: left; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--band-ink); text-wrap: pretty; }
.cf-faq-index .fi-sr{ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@keyframes fi-rise{ from{ opacity: .82; transform: translateY(8px); } to{ opacity: 1; transform: none; } }
@media (min-width: 1024px){ .cf-faq-index .fi-aside .fi-scene{ order: -1; } }
@media (min-width: 1024px) and (min-height: 820px){ .cf-faq-index .fi-aside{ position: sticky; top: 24px; } }
@media (max-width: 1023px){
.cf-faq-index .fi-bento{ grid-template-columns: minmax(0, 1fr); }
.cf-faq-index .fi-aside{ grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.cf-faq-index .fi-aside--single{ grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 859px){ .cf-faq-index .fi-aside{ grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px){
.cf-faq-index .fi-index{ padding: 20px 8px 12px; }
.cf-faq-index .fi-q{ padding: 18px 12px; column-gap: 10px; }
.cf-faq-index .fi-answer{ padding-left: calc(22px + 1.1em); }
.cf-faq-index .fi-chip{ min-height: 44px; }
.cf-faq-index .fi-scene.has-image{ min-height: 420px; }
.cf-faq-index .fi-scene-copy{ align-items: stretch; }
.cf-faq-index .fi-btn{ width: 100%; min-width: 0; padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce){
.cf-faq-index .fi-row{ animation: none; }
.cf-faq-index .fi-row, .cf-faq-index .fi-row::before, .cf-faq-index .fi-prompt, .cf-faq-index .fi-tog, .cf-faq-index .fi-chip, .cf-faq-index .fi-btn, .cf-faq-index .fi-panel, .cf-faq-index .fi-panel.is-open{ transition: none; }
.cf-faq-index .fi-row:hover .fi-prompt, .cf-faq-index .fi-row.is-hover .fi-prompt, .cf-faq-index .fi-btn:hover:not(:disabled), .cf-faq-index .fi-btn.is-hover, .cf-faq-index .fi-btn:active:not(:disabled), .cf-faq-index .fi-chip:active{ transform: none; }
}
`;
pieces/content/faq-index/specimen.tsx 56 lines
import __studioImage26656505 from "../assets/44596a96aa76363e.webp";
import React from "react";
import { FaqIndex } from "../faq-index";
import { slot } from "../../slots";
import defaults from "../../studio-defaults.json";
export const states = ["default", "hover", "disabled"];
type Props = React.ComponentProps<typeof FaqIndex>;
const topics: Props["topics"] = [
{ id: "beans", label: "beans", headline: "Roasted the week it ships" },
{ id: "delivery", label: "delivery", headline: "Coffee that lands before you run out" },
{ id: "plan", label: "your plan", headline: "A plan that bends around your week" },
];
const items: Props["items"] = [
{ topic: "beans", question: "how fresh is the coffee when it arrives?", answer: "We roast every bag the week it ships and print the roast date on the label, so you always know exactly how fresh your beans are." },
{ topic: "beans", question: "can i get it ground for my brewer?", answer: "Yes. Pick whole bean, or a grind for pour-over, drip, espresso, French press or AeroPress when you set up your plan." },
{ topic: "beans", question: "what if i don't know what i like yet?", answer: "Start with the Roaster's Pick. Each box brings a different origin with tasting notes, and your ratings steer the next one." },
{ topic: "delivery", question: "how often will my coffee come?", answer: "Every 1, 2, 3 or 4 weeks. Most people who brew every morning choose two 12 oz bags every 2 weeks." },
{ topic: "delivery", question: "how much is shipping?", answer: "Nothing. Shipping is free on every subscription box in the US." },
{ topic: "delivery", question: "do i need to be home when it arrives?", answer: "No. Each box is slim enough to slip through a standard mail slot." },
{ topic: "plan", question: "can i skip, pause or cancel?", answer: "Anytime, from your account. Skip a box, pause for a month or cancel before your next ship date, with no fee." },
{ topic: "plan", question: "can i send it as a gift?", answer: "Yes. Choose a gift plan of 3, 6 or 12 boxes and add a personal note at checkout." },
{ topic: "plan", question: "what if i don't love a bag?", answer: "You're covered by our 30-day money-back guarantee. Tell us and we'll refund the box or send a different roast." },
];
export default function FaqIndexSpecimen({ state = "default" }: { state?: string }) {
return (
<FaqIndex
headline="Good questions to ask before"
emphasis="your first bag ships"
lead="Fresh-roasted coffee at your door, on your schedule. Here's how Crate & Kettle works."
topics={topics}
items={items}
defaultOpen={[0]}
sceneImage={slot("scene", __studioImage26656505)}
sceneImageAlt="Pour-over coffee brewing on a sunlit kitchen counter"
ctaQuestion="Ready for fresher mornings?"
ctaLabel="Yes, start my first box"
ctaNote="Free shipping · Skip or cancel anytime"
receiptTitle="Your first box, rung up"
receiptLines={[
{ label: "2 × 12 oz bags, Roaster's Pick", value: "$34.00" },
{ label: "Shipping", value: "Free" },
{ label: "Subtotal", value: "$34.00", kind: "subtotal" },
{ label: "First-box discount", value: "−$10.00", kind: "discount" },
]}
totalLabel="Today"
total="$24.00"
receiptNote={defaults.sample.guarantee + " · Then $34 every 2 weeks"}
state={state as Props["state"]}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalFaqIndex |
React.ReactNode |
|
emphasis OptionalFaqIndex |
React.ReactNode |
|
lead OptionalFaqIndex |
React.ReactNode |
|
items OptionalFaqIndex |
FaqIndexItem[] |
|
topics OptionalFaqIndex |
FaqIndexTopic[] |
|
allLabel OptionalFaqIndex |
string |
|
filterLabel OptionalFaqIndex |
string |
|
resultsLabel OptionalFaqIndex |
string |
|
defaultOpen OptionalFaqIndex |
number[] |
|
lowercase OptionalFaqIndex |
boolean |
|
sceneImage OptionalFaqIndex |
string |
|
sceneImageAlt OptionalFaqIndex |
string |
|
ctaQuestion OptionalFaqIndex |
React.ReactNode |
|
ctaLabel OptionalFaqIndex |
string |
|
ctaNote OptionalFaqIndex |
React.ReactNode |
|
href OptionalFaqIndex |
string |
|
onAction OptionalFaqIndex |
() => void |
|
disabled OptionalFaqIndex |
boolean |
|
receiptTitle OptionalFaqIndex |
React.ReactNode |
|
receiptLines OptionalFaqIndex |
FaqIndexReceiptLine[] |
|
totalLabel OptionalFaqIndex |
string |
|
total OptionalFaqIndex |
string |
|
receiptNote OptionalFaqIndex |
React.ReactNode |
|
state OptionalFaqIndex |
"default" | "hover" | "disabled" |
|
className OptionalFaqIndex |
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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
44596a96aa76363e.webp
image/webp · 40.6 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB