Content Library Preview 1
Content library preview: every lesson and download, grouped by topic on a path that ends at the value, the price and the button, so the organised inventory sells the access.
Use it in a prompt
Use content/content-library-preview 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/content-library-preview.tsx. - Import it and pass your copy and images (Props tab):
import { ContentLibraryPreview } from "@/components/funneldna/content/content-library-preview"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/content-library-preview/component.tsx 535 lines
// layout: path-to-action
// Content library preview: every lesson and download, grouped by topic on a path that ends at the value, the price and the button, so the organised inventory sells the access.
import React, { useId, useState } from "react";
import { ChevronDown, Clock3, FileText, KeyRound, LayoutTemplate, Lock, ShieldCheck, Video } from "lucide-react";
import { FX_HOST, Mesh, Spot } from "../fx/fx";
export type ContentLibraryItemType = "video" | "download" | "template";
export type ContentLibraryItem = {
title: string;
/** Row icon and count bucket; defaults to "video". */
type?: ContentLibraryItemType;
/** Running time in minutes; shown on the row and summed into the totals. */
minutes?: number;
/** Shown instead of minutes, e.g. "24 pages". */
length?: string;
/** Optional thumbnail (an item or product image). */
image?: string;
imageAlt?: string;
};
export type ContentLibraryGroup = {
title: string;
items: ContentLibraryItem[];
/** An imported fx Spot asset drawn as this stop on the path. */
spot?: string;
/** Start open or closed; overrides openGroups. */
open?: boolean;
};
export type ContentLibraryCopy = {
/** Singular and plural nouns per item type, used in the tally and the group lines. */
types: Record<ContentLibraryItemType, { one: string; other: string }>;
/** Screen-reader name per item type, read before each title. */
typeNames: Record<ContentLibraryItemType, string>;
/** "{count} {noun}" */
groupCount: string;
separator: string;
/** "{hours}h {minutes}m" */
runtimeHoursMinutes: string;
/** "{hours}h" */
runtimeHours: string;
/** "{minutes} min" */
runtimeMinutes: string;
runtimeLabel: string;
tallyLabel: string;
rowAction: string;
/** "Unlock {title}" */
rowActionAria: string;
};
export type ContentLibraryPreviewProps = {
headline?: string;
/** Phrase inside the headline that gets the highlighter stroke. */
headlineMark?: string;
/** Short paragraphs, each opening with a bold lead-in. */
intro?: { lead: string; text: string }[];
groups?: ContentLibraryGroup[];
/** How many groups start open, from the top. */
openGroups?: number;
/** Product slot image shown in the closing card. */
productImage?: string;
productImageAlt?: string;
/** An imported fx Spot asset for the final stop on the path. */
closeSpot?: string;
valueLabel?: string;
/** Total value of everything listed; supplied facts only. */
totalValue?: string;
valueTurn?: string;
priceLabel?: string;
/** Today's price; supplied facts only. */
price?: string;
priceNote?: string;
/** The question the button answers. */
question?: string;
label?: string;
/** Guarantee or reassurance line under the button; supplied facts only. */
reassurance?: string;
href?: string;
/** Called by the main button (no item) and by each row's unlock action (with its item). */
onAction?: (item?: ContentLibraryItem) => void;
copy?: Partial<ContentLibraryCopy>;
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
const TYPES: ContentLibraryItemType[] = ["video", "download", "template"];
const COPY: ContentLibraryCopy = {
types: {
video: { one: "video lesson", other: "video lessons" },
download: { one: "download", other: "downloads" },
template: { one: "template", other: "templates" },
},
typeNames: { video: "Video lesson", download: "Download", template: "Template" },
groupCount: "{count} {noun}",
separator: " · ",
runtimeHoursMinutes: "{hours}h {minutes}m",
runtimeHours: "{hours}h",
runtimeMinutes: "{minutes} min",
runtimeLabel: "of video teaching",
tallyLabel: "What the library holds",
rowAction: "Unlock",
rowActionAria: "Unlock {title}",
};
const DEFAULT_INTRO = [
{ lead: "Every lesson has one job.", text: "Open the topic you need right now and start there." },
{ lead: "Open any topic below.", text: "Each one lists every lesson and download it holds." },
];
const DEFAULT_GROUPS: ContentLibraryGroup[] = [
{
title: "Start with the essentials",
items: [
{ title: "Get clear on where you are starting", minutes: 18 },
{ title: "Set one goal for the next 30 days", minutes: 22 },
{ title: "Quick-start workbook", type: "download", length: "12 pages" },
],
},
{
title: "Put it into practice",
items: [
{ title: "Build your first plan step by step", minutes: 26 },
{ title: "Fix the mistakes that slow most people down", minutes: 19 },
{ title: "Planning template", type: "template", length: "1 file" },
],
},
];
export function ContentLibraryPreview({
headline = "See everything you get before you start",
headlineMark = "everything you get",
intro = DEFAULT_INTRO,
groups = DEFAULT_GROUPS,
openGroups = 1,
productImage,
productImageAlt = "",
closeSpot,
valueLabel = "Everything above is valued at",
totalValue = "",
valueTurn = "But you won't pay that.",
priceLabel = "Your price today",
price = "",
priceNote = "",
question = "Ready to open your first lesson?",
label = "I'm ready, open the library",
reassurance = "",
href,
onAction,
copy,
state = "default",
className,
}: ContentLibraryPreviewProps) {
const c: ContentLibraryCopy = { ...COPY, ...copy };
const id = "clp" + useId().replace(/[^a-zA-Z0-9_-]/g, "");
const [toggled, setToggled] = useState<Record<number, boolean>>({});
const isOpen = (g: ContentLibraryGroup, i: number) => toggled[i] ?? g.open ?? i < openGroups;
const totals = tally(groups);
const stats = [
...TYPES.filter((t) => totals.counts[t] > 0).map((t) => ({
key: t,
value: String(totals.counts[t]),
label: noun(c, t, totals.counts[t]),
})),
...(totals.minutes > 0 ? [{ key: "runtime", value: runtime(c, totals.minutes), label: c.runtimeLabel }] : []),
];
const disabled = state === "disabled";
const ctaClass = ["clp-cta", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""]
.filter(Boolean)
.join(" ");
const showReveal = Boolean(totalValue || price || priceNote);
return (
<section
className={["cf-content-library-preview", className].filter(Boolean).join(" ")}
aria-labelledby={`${id}-title`}
>
<style>{CSS}</style>
<div className="clp-foot" aria-hidden="true" />
<div className="clp-bg" style={{ ...FX_HOST, position: "absolute" }} aria-hidden="true">
<Mesh variant="dark" />
</div>
<div className="clp-wrap">
<header className="clp-head">
<div>
<h2 className="clp-title" id={`${id}-title`}>
{markHeadline(headline, headlineMark)}
</h2>
{intro.length > 0 && (
<div className="clp-intro">
{intro.map((p, i) => (
<p key={i}>
<strong>{p.lead}</strong> {p.text}
</p>
))}
</div>
)}
</div>
{stats.length > 0 && (
<ul className="clp-tally" aria-label={c.tallyLabel}>
{stats.map((s) => (
<li className="clp-stat" key={s.key}>
<span className="clp-num">{s.value}</span>
<span className="clp-stat-label">{s.label}</span>
</li>
))}
</ul>
)}
</header>
<ol className="clp-path">
{groups.map((g, i) => {
const open = isOpen(g, i);
const panelId = `${id}-panel-${i}`;
return (
<li
className={`clp-stop${open ? " is-open" : ""}`}
key={`${g.title}-${i}`}
style={{ "--i": i } as React.CSSProperties}
>
<PathNode spot={g.spot} icon={<Video size={20} strokeWidth={2.5} aria-hidden="true" />} />
<div className="clp-card">
<h3 className="clp-group-h">
<button
type="button"
className="clp-toggle"
aria-expanded={open}
aria-controls={panelId}
onClick={() => setToggled((t) => ({ ...t, [i]: !open }))}
>
<span className="clp-group-text">
<span className="clp-group-title">{g.title}</span>
<span className="clp-group-meta">{groupMeta(c, g)}</span>
</span>
<span className="clp-chev" aria-hidden="true">
<ChevronDown size={20} strokeWidth={2.5} />
</span>
</button>
</h3>
<div className="clp-panel" id={panelId}>
<div className="clp-panel-inner">
<ul className="clp-rows">
{g.items.map((item, j) => (
<LibraryRow key={`${item.title}-${j}`} item={item} copy={c} href={href} onAction={onAction} />
))}
</ul>
</div>
</div>
</div>
</li>
);
})}
<li className="clp-stop is-close" style={{ "--i": groups.length } as React.CSSProperties}>
<PathNode spot={closeSpot} icon={<KeyRound size={20} strokeWidth={2.5} aria-hidden="true" />} />
<div className={`clp-card clp-close${productImage ? "" : " no-img"}`}>
{productImage && (
<div className="clp-product-wrap">
<img className="clp-product" src={productImage} alt={productImageAlt} loading="lazy" />
</div>
)}
<div className="clp-offer">
{showReveal && (
<div className="clp-reveal">
{totalValue && (
<>
<p className="clp-value-label">{valueLabel}</p>
<p className="clp-value">{totalValue}</p>
</>
)}
{totalValue && price && <p className="clp-turn">{valueTurn}</p>}
{price && (
<p className="clp-today">
<span className="clp-today-label">{priceLabel}</span>
<span className="clp-price">{price}</span>
</p>
)}
{priceNote && <p className="clp-note">{priceNote}</p>}
</div>
)}
<h3 className="clp-question">{question}</h3>
{href && !disabled ? (
<a className={ctaClass} href={href} onClick={() => onAction?.()}>
{label}
</a>
) : (
<button type="button" className={ctaClass} disabled={disabled} onClick={() => onAction?.()}>
{label}
</button>
)}
{reassurance && (
<p className="clp-reassure">
<ShieldCheck className="clp-inline-icon" size={18} strokeWidth={2.5} aria-hidden="true" />
{reassurance}
</p>
)}
</div>
</div>
</li>
</ol>
</div>
</section>
);
}
export default ContentLibraryPreview;
function PathNode({ spot, icon }: { spot?: string; icon: React.ReactNode }) {
return (
<div className="clp-node" aria-hidden="true">
<div className="clp-node-inner">
{spot ? (
<Spot src={spot} size={56} shade="band" light="band-ink" />
) : (
<span className="clp-node-disc">{icon}</span>
)}
</div>
</div>
);
}
function LibraryRow({
item,
copy,
href,
onAction,
}: {
item: ContentLibraryItem;
copy: ContentLibraryCopy;
href?: string;
onAction?: (item?: ContentLibraryItem) => void;
}) {
const type = item.type ?? "video";
const Icon = type === "video" ? Video : type === "template" ? LayoutTemplate : FileText;
const MetaIcon = type === "video" ? Clock3 : FileText;
const length = item.length ?? (item.minutes ? fill(copy.runtimeMinutes, { minutes: item.minutes }) : "");
const aria = fill(copy.rowActionAria, { title: item.title });
const inner = (
<>
<Lock size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.rowAction}
</>
);
return (
<li className="clp-row">
<span className={`clp-media${item.image ? " has-img" : ""}`}>
{item.image ? (
<img src={item.image} alt={item.imageAlt ?? ""} loading="lazy" />
) : (
<Icon size={18} strokeWidth={2.5} aria-hidden="true" />
)}
</span>
<span className="clp-row-title">
<span className="clp-sr">{copy.typeNames[type]}: </span>
{item.title}
</span>
<span className="clp-row-meta">
{length && (
<>
<MetaIcon size={16} strokeWidth={2.5} aria-hidden="true" />
{length}
</>
)}
</span>
{href ? (
<a className="clp-unlock" href={href} aria-label={aria} onClick={() => onAction?.(item)}>
{inner}
</a>
) : (
<button type="button" className="clp-unlock" aria-label={aria} onClick={() => onAction?.(item)}>
{inner}
</button>
)}
</li>
);
}
function fill(template: string, vars: Record<string, string | number>) {
return Object.keys(vars).reduce((out, key) => out.split(`{${key}}`).join(String(vars[key])), template);
}
function noun(copy: ContentLibraryCopy, type: ContentLibraryItemType, count: number) {
const n = copy.types[type];
return count === 1 ? n.one : n.other;
}
function runtime(copy: ContentLibraryCopy, total: number) {
const hours = Math.floor(total / 60);
const minutes = total % 60;
if (hours === 0) return fill(copy.runtimeMinutes, { minutes });
if (minutes === 0) return fill(copy.runtimeHours, { hours });
return fill(copy.runtimeHoursMinutes, { hours, minutes });
}
function tally(groups: ContentLibraryGroup[]) {
const counts: Record<ContentLibraryItemType, number> = { video: 0, download: 0, template: 0 };
let minutes = 0;
groups.forEach((g) =>
g.items.forEach((it) => {
counts[it.type ?? "video"] += 1;
minutes += it.minutes ?? 0;
}),
);
return { counts, minutes };
}
function groupMeta(copy: ContentLibraryCopy, g: ContentLibraryGroup) {
const t = tally([g]);
const parts = TYPES.filter((k) => t.counts[k] > 0).map((k) =>
fill(copy.groupCount, { count: t.counts[k], noun: noun(copy, k, t.counts[k]) }),
);
if (t.minutes > 0) parts.push(runtime(copy, t.minutes));
return parts.join(copy.separator);
}
function markHeadline(text: string, mark?: string) {
if (!mark) return text;
const at = text.indexOf(mark);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="clp-mark">{mark}</span>
{text.slice(at + mark.length)}
</>
);
}
const CSS = `
.cf-content-library-preview{--clp-node:56px;--clp-node-top:14px;--clp-gap:clamp(20px,2.4vw,28px);--clp-overhang:clamp(72px,9vw,128px);--clp-pad-b:clamp(56px,7vw,96px);--clp-sh:var(--shadow,oklch(0.22 0.03 260));--clp-bb:var(--button-bg,var(--cta));--clp-bb2:var(--button-bg-2,var(--cta-2));position:relative;isolation:isolate;overflow-x:clip;background:var(--band);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) var(--clp-pad-b)}
.cf-content-library-preview .clp-foot{position:absolute;left:0;right:0;bottom:0;height:calc(var(--clp-pad-b) + var(--clp-overhang) + 1px);z-index:-1;background:var(--surface);pointer-events:none}
.cf-content-library-preview *{box-sizing:border-box}
.cf-content-library-preview :where(h2,h3,p,ol,ul,li){margin:0;padding:0}
.cf-content-library-preview :where(ol,ul){list-style:none}
.cf-content-library-preview .clp-bg{inset:0;bottom:calc(var(--clp-pad-b) + var(--clp-overhang));z-index:-1;background:var(--band);overflow:hidden;pointer-events:none}
.cf-content-library-preview .clp-wrap{position:relative;max-width:1120px;margin:0 auto}
.cf-content-library-preview .clp-head{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:clamp(32px,5vw,72px);align-items:start;color:var(--band-ink)}
.cf-content-library-preview .clp-title{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-content-library-preview .clp-mark{background:var(--clp-marker,var(--bump-strip,#f6dc5c));color:var(--clp-marker-ink,var(--bump-ink,var(--ink)));padding:0 .14em;margin:0 -.02em;border-radius:.14em .34em .2em .38em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-content-library-preview .clp-intro{display:grid;gap:12px;margin-top:16px;max-width:62ch}
.cf-content-library-preview .clp-intro p{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-content-library-preview .clp-intro strong{font-weight:800}
.cf-content-library-preview .clp-stat{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;padding:14px 0}
.cf-content-library-preview .clp-stat:first-child{padding-top:0}
.cf-content-library-preview .clp-stat:not(:last-child){border-bottom:1px solid oklch(from var(--band-ink) l c h / .22)}
.cf-content-library-preview .clp-num{font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.cf-content-library-preview .clp-stat-label{font-size:1.0625rem;font-weight:600;line-height:1.4}
.cf-content-library-preview .clp-path{display:grid;gap:var(--clp-gap);margin-top:clamp(40px,6vw,72px)}
.cf-content-library-preview .clp-stop{position:relative;display:grid;grid-template-columns:var(--clp-node) minmax(0,1fr);gap:clamp(10px,2vw,24px);align-items:start;animation:clp-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
.cf-content-library-preview .clp-stop:not(:last-child)::before{content:"";position:absolute;left:calc(var(--clp-node) / 2 - 1px);top:calc(var(--clp-node-top) + var(--clp-node) + 8px);bottom:calc(8px - var(--clp-gap) - var(--clp-node-top));width:2px;border-radius:2px;background:oklch(from var(--band-ink) l c h / .32)}
.cf-content-library-preview .clp-node{width:var(--clp-node);height:var(--clp-node);margin-top:var(--clp-node-top)}
.cf-content-library-preview .clp-node-inner{width:56px;height:56px;display:grid;place-items:center;transform-origin:0 0}
.cf-content-library-preview .clp-node-disc{width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-content-library-preview .clp-card{min-width:0;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--clp-sh) l c h / .22),0 4px 10px -2px oklch(from var(--clp-sh) l c h / .2)));overflow:hidden}
.cf-content-library-preview .clp-group-h{font-size:inherit;font-weight:inherit}
.cf-content-library-preview .clp-toggle{appearance:none;width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:clamp(18px,2.4vw,24px) clamp(20px,3vw,32px);border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background .16s ease}
.cf-content-library-preview .clp-toggle:hover{background:color-mix(in oklch,var(--ink) 3%,var(--card))}
.cf-content-library-preview .clp-toggle:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:-3px}
.cf-content-library-preview .clp-group-text{min-width:0}
.cf-content-library-preview .clp-group-title{display:block;font-family:var(--font-display);font-weight:800;letter-spacing:-.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-content-library-preview .clp-group-meta{display:block;margin-top:8px;font-family:var(--font-body);font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-content-library-preview .clp-chev{width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);transition:transform .25s cubic-bezier(.2,.7,.2,1)}
.cf-content-library-preview .is-open .clp-chev{transform:rotate(180deg)}
.cf-content-library-preview .clp-panel{display:grid;grid-template-rows:0fr;visibility:hidden;transition:grid-template-rows .32s cubic-bezier(.2,.7,.2,1),visibility 0s linear .32s}
.cf-content-library-preview .is-open .clp-panel{grid-template-rows:1fr;visibility:visible;transition:grid-template-rows .32s cubic-bezier(.2,.7,.2,1),visibility 0s linear 0s}
.cf-content-library-preview .clp-panel-inner{min-height:0;overflow:hidden}
.cf-content-library-preview .clp-rows{border-top:1px solid oklch(from var(--ink) l c h / .1)}
.cf-content-library-preview .clp-row{display:grid;grid-template-columns:44px minmax(0,1fr) 7.5rem auto;grid-template-areas:"media title meta action";align-items:center;gap:8px 16px;min-height:68px;padding:12px clamp(20px,3vw,32px);transition:background .16s ease}
.cf-content-library-preview .clp-row + .clp-row{border-top:1px solid oklch(from var(--ink) l c h / .08)}
.cf-content-library-preview .clp-row:hover{background:color-mix(in oklch,var(--ink) 3%,var(--card))}
.cf-content-library-preview .clp-media{grid-area:media;width:44px;height:44px;border-radius:10px;display:grid;place-items:center;background:color-mix(in oklch,var(--ink) 5%,var(--card));color:var(--accent)}
.cf-content-library-preview .clp-media.has-img{background:transparent}
.cf-content-library-preview .clp-media img{display:block;width:44px;height:44px;border-radius:8px;object-fit:cover;object-position:center}
.cf-content-library-preview .clp-row-title{grid-area:title;min-width:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:600;line-height:1.35;text-wrap:pretty}
.cf-content-library-preview .clp-row-meta{grid-area:meta;display:inline-flex;align-items:center;gap:6px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-content-library-preview .clp-row-meta svg,.cf-content-library-preview .clp-unlock svg{flex-shrink:0}
.cf-content-library-preview .clp-unlock{grid-area:action;appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:.9375rem;line-height:1;white-space:nowrap;text-decoration:none;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-content-library-preview .clp-unlock:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
.cf-content-library-preview .clp-unlock:active{transform:translateY(1px);box-shadow:none}
.cf-content-library-preview .clp-unlock:focus-visible,.cf-content-library-preview .clp-cta:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:3px}
.cf-content-library-preview .clp-close{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:clamp(20px,4vw,48px);align-items:start;padding:clamp(24px,3.4vw,40px);border-color:color-mix(in oklch,var(--accent) 32%,var(--card));box-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--clp-sh) l c h / .22),0 12px 24px -8px oklch(from var(--clp-sh) l c h / .32))}
.cf-content-library-preview .clp-close.no-img{grid-template-columns:minmax(0,1fr)}
.cf-content-library-preview .clp-product-wrap{display:flex;justify-content:center}
.cf-content-library-preview .clp-product{display:block;width:100%;height:auto;max-height:340px;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--clp-sh) l c h / .25)) drop-shadow(0 14px 16px oklch(from var(--clp-sh) l c h / .22))}
.cf-content-library-preview .clp-offer{min-width:0}
.cf-content-library-preview .clp-reveal{padding:20px 24px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-content-library-preview .clp-value-label{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-content-library-preview .clp-value{margin-top:8px;font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-content-library-preview .clp-turn{margin-top:16px;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance}
.cf-content-library-preview .clp-today{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px;margin-top:12px}
.cf-content-library-preview .clp-today-label{font-size:1.0625rem;font-weight:600;line-height:1.4;color:var(--ink)}
.cf-content-library-preview .clp-price{font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--accent)}
.cf-content-library-preview .clp-note{margin-top:12px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-content-library-preview .clp-question{margin-top:28px;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance}
.cf-content-library-preview .clp-reveal + .clp-question{margin-top:28px}
.cf-content-library-preview .clp-offer > .clp-question:first-child{margin-top:0}
.cf-content-library-preview .clp-cta{display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:min(100%,20rem);max-width:100%;min-height:72px;margin-top:16px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--clp-bb) calc(l + .04) c h),oklch(from var(--clp-bb2) calc(l - .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-wrap:balance;text-decoration:none;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--clp-bb) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--clp-bb) calc(l - .16) c h),0 1px 2px oklch(from var(--clp-sh) l c h / .3),0 8px 16px -6px oklch(from var(--clp-sh) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-content-library-preview .clp-cta:hover:not(:disabled),.cf-content-library-preview .clp-cta.is-hover{background:linear-gradient(oklch(from var(--clp-bb) calc(l - .01) c h),oklch(from var(--clp-bb2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--clp-bb) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--clp-bb) calc(l - .2) c h),0 1px 2px oklch(from var(--clp-sh) l c h / .32),0 12px 20px -8px oklch(from var(--clp-sh) l c h / .5)}
.cf-content-library-preview .clp-cta:active:not(:disabled),.cf-content-library-preview .clp-cta.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--clp-bb) calc(l - .04) c h),oklch(from var(--clp-bb2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--clp-bb) calc(l - .22) c h / .5),inset 0 -2px 0 oklch(from var(--clp-bb) calc(l - .16) c h),0 1px 2px oklch(from var(--clp-sh) l c h / .3)}
.cf-content-library-preview .clp-cta:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 10%,var(--card));color:var(--ink);text-shadow:none;box-shadow:none;transform:none}
.cf-content-library-preview .clp-reassure{margin-top:12px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-content-library-preview .clp-inline-icon{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em;color:var(--success)}
.cf-content-library-preview .clp-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@keyframes clp-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (max-width:760px){
.cf-content-library-preview .clp-head{grid-template-columns:minmax(0,1fr);gap:32px}
.cf-content-library-preview .clp-close{grid-template-columns:minmax(0,1fr);gap:20px}
.cf-content-library-preview .clp-product{max-height:220px}
}
@media (max-width:640px){
.cf-content-library-preview{--clp-node:36px;--clp-node-top:12px}
.cf-content-library-preview .clp-node-inner{transform:scale(.6429)}
.cf-content-library-preview .clp-stop{gap:10px}
.cf-content-library-preview .clp-stop:nth-last-child(2)::before{bottom:0}
.cf-content-library-preview .clp-stop.is-close{grid-template-columns:minmax(0,1fr)}
.cf-content-library-preview .clp-stop.is-close .clp-node{display:none}
.cf-content-library-preview .clp-toggle{padding:16px;gap:12px}
.cf-content-library-preview .clp-row{grid-template-columns:44px minmax(0,1fr) auto;grid-template-areas:"media title title" "media meta action";align-items:start;gap:8px 12px;padding:14px 16px}
.cf-content-library-preview .clp-row-meta{align-self:center;justify-self:start;font-size:.875rem}
.cf-content-library-preview .clp-unlock{padding:0 12px;gap:6px;font-size:.875rem}
.cf-content-library-preview .clp-close{padding:24px 20px}
.cf-content-library-preview .clp-offer{text-align:center}
.cf-content-library-preview .clp-today{justify-content:center}
.cf-content-library-preview .clp-reveal{padding:16px 18px}
.cf-content-library-preview .clp-cta{width:100%;padding:12px 20px}
}
@media (prefers-reduced-motion:reduce){
.cf-content-library-preview .clp-stop{animation:none}
.cf-content-library-preview .clp-panel,.cf-content-library-preview .is-open .clp-panel,.cf-content-library-preview .clp-chev,.cf-content-library-preview .clp-toggle,.cf-content-library-preview .clp-row,.cf-content-library-preview .clp-unlock,.cf-content-library-preview .clp-cta{transition:none}
}
`;
pieces/content/content-library-preview/specimen.tsx 82 lines
import __studioImageb2047913 from "../assets/810709d4a0c20c37.webp";
// Specimen: the Funnel Starter Kit's lessons and downloads, grouped by topic on a path that leads to the value, the price and the button.
import React from "react";
import { ContentLibraryPreview } from "../content-library-preview";
import type { ContentLibraryGroup } from "../content-library-preview";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
import pin from "../../fx/spots/pin";
import book from "../../fx/spots/book";
import checklist from "../../fx/spots/checklist";
import rocket from "../../fx/spots/rocket";
export const states = ["default", "hover", "active", "disabled"];
const sample = defaults.sample;
const [guide, workbook, launch] = sample.items;
const groups: ContentLibraryGroup[] = [
{
title: "Plan an offer people say yes to",
spot: pin,
items: [
{ title: "Find the one problem your funnel solves", minutes: 18 },
{ title: "Shape an offer that feels like an easy yes", minutes: 24 },
{ title: "Pick only the pages your funnel needs", minutes: 21 },
{ title: guide.name, type: "download", length: "48 pages", image: guide.image, imageAlt: guide.imageAlt },
],
},
{
title: "Write pages that earn the click",
spot: book,
items: [
{ title: "Write a headline in ten minutes", minutes: 16 },
{ title: "Turn features into reasons to buy", minutes: 22 },
{ title: "Build a button people want to press", minutes: 19 },
{ title: "Tell your story without rambling", minutes: 26 },
{ title: workbook.name, type: "download", length: "32 pages", image: workbook.image, imageAlt: workbook.imageAlt },
],
},
{
title: "Launch without second-guessing",
spot: checklist,
items: [
{ title: "Test every link and form before launch", minutes: 14 },
{ title: "Set up the emails that follow up for you", minutes: 23 },
{ title: "Read your first numbers with a clear head", minutes: 17 },
{ title: launch.name, type: "download", length: "6 pages", image: launch.image, imageAlt: launch.imageAlt },
],
},
];
export default function ContentLibraryPreviewSpecimen({
state = "default",
}: {
state?: "default" | "hover" | "active" | "disabled";
}) {
return (
<ContentLibraryPreview
state={state}
headline={`See every lesson inside ${sample.name}`}
headlineMark="every lesson"
intro={[
{ lead: "Every lesson has one job.", text: "Plan the offer, write the page or launch it. Open the topic you need tonight." },
{ lead: "The guide, workbook and checklist come with it.", text: "Use them as you watch, so each lesson ends with work you keep." },
]}
groups={groups}
openGroups={2}
productImage={slot(
"product",
__studioImageb2047913,
)}
productImageAlt={`${sample.name} lessons open on a laptop`}
closeSpot={rocket}
totalValue={sample.regularPrice}
price={sample.price}
priceNote={sample.note}
question="Ready to plan your first funnel tonight?"
label="I'm ready, open the kit"
reassurance={sample.guarantee}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalContentLibraryPreview |
string |
Default "See everything you get before you start"
|
headlineMark OptionalContentLibraryPreview |
string |
Default "everything you get"
|
intro OptionalContentLibraryPreview |
{ lead: string; text: string }[] |
Default DEFAULT_INTRO
|
groups OptionalContentLibraryPreview |
ContentLibraryGroup[] |
Default DEFAULT_GROUPS
|
openGroups OptionalContentLibraryPreview |
number |
Default 1
|
productImage OptionalContentLibraryPreview |
string |
|
productImageAlt OptionalContentLibraryPreview |
string |
Default ""
|
closeSpot OptionalContentLibraryPreview |
string |
|
valueLabel OptionalContentLibraryPreview |
string |
Default "Everything above is valued at"
|
totalValue OptionalContentLibraryPreview |
string |
Default ""
|
valueTurn OptionalContentLibraryPreview |
string |
Default "But you won't pay that."
|
priceLabel OptionalContentLibraryPreview |
string |
Default "Your price today"
|
price OptionalContentLibraryPreview |
string |
Default ""
|
priceNote OptionalContentLibraryPreview |
string |
Default ""
|
question OptionalContentLibraryPreview |
string |
Default "Ready to open your first lesson?"
|
label OptionalContentLibraryPreview |
string |
Default "I'm ready, open the library"
|
reassurance OptionalContentLibraryPreview |
string |
Default ""
|
href OptionalContentLibraryPreview |
string |
|
onAction OptionalContentLibraryPreview |
(item?: ContentLibraryItem) => void |
|
copy OptionalContentLibraryPreview |
Partial<ContentLibraryCopy> |
|
state OptionalContentLibraryPreview |
"default" | "hover" | "active" | "disabled" |
Default "default"
|
className OptionalContentLibraryPreview |
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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
0d114386aa55e8d2.webp
image/webp · 15.6 KB
-
810709d4a0c20c37.webp
image/webp · 33.2 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
d0943b629c0b1324.webp
image/webp · 8.87 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
d7814fce240ddf0e.webp
image/webp · 17.6 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB