Download Library 1
Customer shelf for a template shop: a newspaper-style front page of everything the buyer owns, narrowed live by
Use it in a prompt
Use checkout/download-library 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/checkout/download-library.tsx. - Import it and pass your copy and images (Props tab):
import { DownloadLibrary } from "@/components/funneldna/checkout/download-library"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/download-library/component.tsx 652 lines
// layout: advertorial-front
// Customer shelf for a template shop: a newspaper-style front page of everything the buyer owns, narrowed live by
// search and format chips, with one paid pick from the shop in the side column to lift perceived value and reorders.
import * as React from "react";
import { Check, Loader2, Scissors, Search, X } from "lucide-react";
import { FX_HOST, Pattern, Spot } from "../fx/fx";
import book from "../fx/spots/book";
export type LibraryProduct = {
/** Stable key; falls back to the title. */
id?: string;
title: string;
/** One short line about the template. */
detail?: string;
/** Cover on a transparent background (slot: item-n). */
image?: string;
imageAlt?: string;
/** Format chips, e.g. ["PDF", "Figma", "Notion"]; they also feed the filter. */
formats: string[];
/** Download size as shown, e.g. "12.4 MB". */
size?: string;
/** Number of files in the download. */
files?: number;
/** Direct download URL; without it the button only calls onDownload. */
href?: string;
/** "processing" disables the download until the files are ready. */
status?: "ready" | "processing";
};
export type LibraryPick = {
title: string;
detail?: string;
/** Cover on a transparent background (slot: item-n). */
image?: string;
imageAlt?: string;
formats?: string[];
/** Today's price, e.g. "$19". */
price: string;
/** Struck regular price, only when real. */
regularPrice?: string;
/** The coupon's saving line, e.g. "Shelf customers save $10". */
saving?: string;
/** Coupon code shown inside the coupon. */
code?: string;
/** First-person button label, e.g. "Yes! I want the Promo Pack". */
label: string;
/** One short reassurance line under the button. */
note?: string;
href?: string;
};
/** Templates use {count}, {shown}, {total}, {products}, {title} and {value}. */
export type DownloadLibraryCopy = {
shelfLine: string;
shelfValueLine: string;
searchLabel: string;
searchPlaceholder: string;
clearSearch: string;
filterLabel: string;
allFormats: string;
formatsLabel: string;
showing: string;
productSingular: string;
productPlural: string;
fileSingular: string;
filePlural: string;
clearFilters: string;
emptyTitle: string;
emptyHint: string;
emptyLibrary: string;
download: string;
downloadLabel: string;
processing: string;
regularLabel: string;
codeLabel: string;
};
export type DownloadLibraryProps = {
/** Shop name set as the masthead nameplate. */
storeName?: string;
/** Dateline on the masthead, e.g. "Updated November 21, 2026". */
dateline?: string;
/** Total value of the shelf, e.g. "$163"; shown only when supplied. */
shelfValue?: string;
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string;
lead?: string;
/** Red subhead above the grid. */
shelfHeading?: string;
/** Everything the customer owns. */
products?: LibraryProduct[];
/** Red subhead above the one recommended product. */
pickHeading?: string;
/** The single "you might like" slot; hidden when absent. */
pick?: LibraryPick;
onDownload?: (product: LibraryProduct) => void;
/** Called when the pick's button is clicked. */
onAction?: () => void;
copy?: Partial<DownloadLibraryCopy>;
/** "hover"/"active" force the button states; "disabled" shows every download as still processing. */
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
const COPY: DownloadLibraryCopy = {
shelfLine: "{count} {products} on your shelf",
shelfValueLine: "Shelf value {value}",
searchLabel: "Search your shelf",
searchPlaceholder: "Search {count} {products}, e.g. checklist",
clearSearch: "Clear search",
filterLabel: "Filter by format",
allFormats: "All formats",
formatsLabel: "Formats",
showing: "Showing {shown} of {total} {products}",
productSingular: "product",
productPlural: "products",
fileSingular: "file",
filePlural: "files",
clearFilters: "Clear filters",
emptyTitle: "Nothing matches.",
emptyHint: "Try another word, or show every format again.",
emptyLibrary: "Your templates appear here as soon as your order is ready.",
download: "Download",
downloadLabel: "Download {title}",
processing: "Preparing your files",
regularLabel: "Regular price",
codeLabel: "Code",
};
export function DownloadLibrary(props: DownloadLibraryProps) {
const {
storeName = "",
dateline = "",
shelfValue = "",
headline = "Everything you bought, ready when you are",
highlight = "ready when you are",
lead = "Every template you own lives here. Search it, filter it by format and download it in one click.",
shelfHeading = "Your templates, one click away",
products = [],
pickHeading = "Picked for your next launch",
pick,
onDownload,
onAction,
state = "default",
className,
} = props;
const copy = { ...COPY, ...props.copy };
const uid = React.useId();
const headId = uid + "-head";
const shelfId = uid + "-shelf";
const pickId = uid + "-pick";
const searchId = uid + "-search";
const searchRef = React.useRef<HTMLInputElement>(null);
const [query, setQuery] = React.useState("");
const [picked, setPicked] = React.useState<string[]>([]);
const formats = React.useMemo(() => {
const counts = new Map<string, number>();
products.forEach((p) => p.formats.forEach((f) => counts.set(f, (counts.get(f) ?? 0) + 1)));
return Array.from(counts, ([name, count]) => ({ name, count }));
}, [products]);
const total = products.length;
const q = query.trim().toLowerCase();
const shown = products.filter((p) => {
const formatOk = picked.length === 0 || p.formats.some((f) => picked.includes(f));
const words = [p.title, p.detail ?? "", ...p.formats].join(" ").toLowerCase();
return formatOk && (q === "" || words.includes(q));
});
const filtered = q !== "" || picked.length > 0;
const noun = (n: number) => (n === 1 ? copy.productSingular : copy.productPlural);
const forced = state === "hover" ? " is-hover" : state === "active" ? " is-active" : "";
const isWaiting = (p: LibraryProduct) => state === "disabled" || p.status === "processing";
const firstReady = shown.findIndex((p) => !isWaiting(p));
const toggle = (f: string) =>
setPicked((prev) => (prev.includes(f) ? prev.filter((x) => x !== f) : [...prev, f]));
const clearAll = () => {
setQuery("");
setPicked([]);
searchRef.current?.focus();
};
const shelfLine = [
fill(copy.shelfLine, { count: total, products: noun(total) }),
shelfValue ? fill(copy.shelfValueLine, { value: shelfValue }) : "",
]
.filter(Boolean)
.join(" · ");
const pickCls = "dl-btn dl-btn--big" + forced;
return (
<section
className={"cf-download-library" + (className ? " " + className : "")}
style={FX_HOST}
aria-labelledby={headId}
>
<style>{CSS}</style>
<Pattern name="grid" fade="top" />
<div className="dl-wrap">
<header className="dl-mast">
<div className="dl-plate">
<p className="dl-date dl-date--l">{dateline}</p>
{storeName ? <p className="dl-name">{storeName}</p> : null}
<p className="dl-date dl-date--r">{shelfLine}</p>
</div>
<h2 id={headId} className="dl-headline">
{marked(headline, highlight)}
</h2>
{lead ? <p className="dl-lead">{lead}</p> : null}
</header>
<div className={"dl-front" + (pick ? " has-pick" : "")}>
<div className="dl-main">
<h3 id={shelfId} className="dl-subhead">
{shelfHeading}
</h3>
{total === 0 ? (
<div className="dl-empty">
<Spot src={book} size={88} />
<p className="dl-empty-hint">{copy.emptyLibrary}</p>
</div>
) : (
<>
<div className="dl-index">
<div className={"dl-search" + (query ? " has-q" : "")}>
<label htmlFor={searchId} className="dl-sr">
{copy.searchLabel}
</label>
<Search className="dl-search-icon" size={20} strokeWidth={2.5} aria-hidden="true" />
<input
ref={searchRef}
id={searchId}
className="dl-input"
type="search"
autoComplete="off"
spellCheck={false}
value={query}
placeholder={fill(copy.searchPlaceholder, { count: total, products: noun(total) })}
onChange={(e) => setQuery(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Escape" && query) {
e.preventDefault();
setQuery("");
}
}}
/>
{query ? (
<button
type="button"
className="dl-clear"
aria-label={copy.clearSearch}
onClick={() => {
setQuery("");
searchRef.current?.focus();
}}
>
<X size={18} strokeWidth={2.5} aria-hidden="true" />
</button>
) : null}
</div>
<div className="dl-chips" role="group" aria-label={copy.filterLabel}>
<button
type="button"
className="dl-chip"
aria-pressed={picked.length === 0}
onClick={() => setPicked([])}
>
{picked.length === 0 ? (
<Check className="dl-chip-tick" size={16} strokeWidth={2.5} aria-hidden="true" />
) : null}
{copy.allFormats}
</button>
{formats.map((f) => {
const on = picked.includes(f.name);
return (
<button
key={f.name}
type="button"
className="dl-chip"
aria-pressed={on}
onClick={() => toggle(f.name)}
>
{on ? (
<Check className="dl-chip-tick" size={16} strokeWidth={2.5} aria-hidden="true" />
) : null}
{f.name}
<span className="dl-chip-n">{f.count}</span>
</button>
);
})}
</div>
<p className="dl-count" aria-live="polite">
<span>{fill(copy.showing, { shown: shown.length, total, products: noun(total) })}</span>
{filtered ? (
<button type="button" className="dl-reset" onClick={clearAll}>
{copy.clearFilters}
</button>
) : null}
</p>
</div>
{shown.length > 0 ? (
<ul className="dl-grid" aria-labelledby={shelfId}>
{shown.map((p, i) => (
<ShelfCard
key={p.id ?? p.title}
product={p}
index={i}
picked={picked}
copy={copy}
waiting={isWaiting(p)}
forced={i === firstReady ? forced : ""}
onDownload={onDownload}
/>
))}
</ul>
) : (
<div className="dl-empty">
<Spot src={book} size={88} />
<p className="dl-empty-title">{copy.emptyTitle}</p>
<p className="dl-empty-hint">{copy.emptyHint}</p>
<button type="button" className="dl-btn dl-btn--ghost" onClick={clearAll}>
{copy.clearFilters}
</button>
</div>
)}
</>
)}
</div>
{pick ? (
<aside className="dl-rail" aria-labelledby={pickId}>
<h3 id={pickId} className="dl-subhead">
{pickHeading}
</h3>
<article className="dl-pick">
{pick.image ? (
<div className="dl-pick-cover">
<img
src={pick.image}
alt={pick.imageAlt ?? pick.title}
width={480}
height={360}
loading="lazy"
decoding="async"
/>
</div>
) : null}
<div className="dl-pick-body">
{pick.formats && pick.formats.length > 0 ? (
<ul className="dl-tags" aria-label={copy.formatsLabel}>
{pick.formats.map((f) => (
<li key={f} className="dl-tag">
{f}
</li>
))}
</ul>
) : null}
<h4 className="dl-pick-title">{pick.title}</h4>
{pick.detail ? <p className="dl-pick-detail">{pick.detail}</p> : null}
{pick.saving || pick.code ? (
<p className="dl-coupon">
<Scissors size={18} strokeWidth={2.5} aria-hidden="true" />
{pick.saving ? <span className="dl-coupon-save">{pick.saving}</span> : null}
{pick.code ? (
<span className="dl-coupon-code">
{copy.codeLabel} <b>{pick.code}</b>
</span>
) : null}
</p>
) : null}
<p className="dl-price">
<span className="dl-now">{pick.price}</span>
{pick.regularPrice ? (
<s>
<span className="dl-sr">{copy.regularLabel} </span>
{pick.regularPrice}
</s>
) : null}
</p>
{pick.href ? (
<a className={pickCls} href={pick.href} onClick={() => onAction?.()}>
{pick.label}
</a>
) : (
<button type="button" className={pickCls} onClick={() => onAction?.()}>
{pick.label}
</button>
)}
{pick.note ? <p className="dl-pick-note">{pick.note}</p> : null}
</div>
</article>
</aside>
) : null}
</div>
</div>
</section>
);
}
export default DownloadLibrary;
function ShelfCard({
product,
index,
picked,
copy,
waiting,
forced,
onDownload,
}: {
product: LibraryProduct;
index: number;
picked: string[];
copy: DownloadLibraryCopy;
waiting: boolean;
forced: string;
onDownload?: (product: LibraryProduct) => void;
}) {
const statusId = React.useId();
const fileWord = product.files === 1 ? copy.fileSingular : copy.filePlural;
const meta = [product.files != null ? product.files + " " + fileWord : "", product.size ?? ""]
.filter(Boolean)
.join(" · ");
const label = fill(copy.downloadLabel, { title: product.title });
const cls = "dl-btn dl-btn--card" + forced;
const style = { ["--i" as string]: Math.min(index, 4) } as React.CSSProperties;
return (
<li
className={"dl-card" + (product.image ? " has-cover" : "") + (waiting ? " is-wait" : "")}
style={style}
>
{product.image ? (
<div className="dl-cover">
<img
src={product.image}
alt={product.imageAlt ?? product.title}
width={400}
height={320}
loading="lazy"
decoding="async"
/>
</div>
) : null}
<div className="dl-card-body">
{product.formats.length > 0 ? (
<ul className="dl-tags" aria-label={copy.formatsLabel}>
{product.formats.map((f) => (
<li key={f} className={"dl-tag" + (picked.includes(f) ? " is-on" : "")}>
{f}
</li>
))}
</ul>
) : null}
<h4 className="dl-title">{product.title}</h4>
{product.detail ? <p className="dl-detail">{product.detail}</p> : null}
{meta ? <p className="dl-meta">{meta}</p> : null}
{waiting ? (
<p id={statusId} className="dl-status">
<Loader2 className="dl-spin" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.processing}
</p>
) : null}
<div className="dl-act">
{waiting ? (
<button type="button" className="dl-btn dl-btn--card" disabled aria-describedby={statusId}>
{copy.download}
</button>
) : product.href ? (
<a className={cls} href={product.href} download aria-label={label} onClick={() => onDownload?.(product)}>
{copy.download}
</a>
) : (
<button type="button" className={cls} aria-label={label} onClick={() => onDownload?.(product)}>
{copy.download}
</button>
)}
</div>
</div>
</li>
);
}
function fill(template: string, vars: Record<string, string | number>) {
return Object.keys(vars).reduce((s, k) => s.split("{" + k + "}").join(String(vars[k])), template);
}
function marked(text: string, phrase: string): React.ReactNode {
const at = phrase ? text.indexOf(phrase) : -1;
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="dl-mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
const CSS = `
.cf-download-library{
--dl-ink:var(--ink,#101828);
--dl-muted:var(--muted,#475467);
--dl-subhead:var(--subhead-ink,var(--accent,#1d4ed8));
--dl-shadow:var(--shadow,oklch(0.22 0.03 260));
--dl-btn:var(--button-bg,var(--cta,#d92d20));
--dl-btn-2:var(--button-bg-2,var(--cta-2,#b42318));
--dl-ring:var(--field-focus,var(--accent,#1d4ed8));
position:relative;
overflow-x:clip;
background:var(--surface,#ffffff);
color:var(--dl-ink);
font-family:var(--font-body,system-ui,sans-serif);
padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);
}
.cf-download-library *,.cf-download-library *::before,.cf-download-library *::after{box-sizing:border-box}
.cf-download-library .dl-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-download-library .dl-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-download-library .dl-mast{text-align:center;margin-bottom:clamp(40px,5vw,64px);animation:dl-rise .45s cubic-bezier(.2,.7,.2,1) backwards}
.cf-download-library .dl-plate{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:end;gap:12px 24px;padding-bottom:14px;margin-bottom:8px;border-bottom:3px solid var(--dl-ink)}
.cf-download-library .dl-plate::after{content:"";position:absolute;left:0;right:0;bottom:-8px;height:1px;background:oklch(from var(--ink,#101828) l c h / 0.45)}
.cf-download-library .dl-name{margin:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-download-library .dl-date{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--dl-muted);text-wrap:pretty}
.cf-download-library .dl-date--l{text-align:left}
.cf-download-library .dl-date--r{text-align:right}
.cf-download-library .dl-headline{margin:32px 0 0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance}
.cf-download-library .dl-mark{background:linear-gradient(180deg,transparent 56%,color-mix(in oklch,var(--marker,#fae37c) 88%,transparent) 56%,color-mix(in oklch,var(--marker,#fae37c) 88%,transparent) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .06em}
.cf-download-library .dl-lead{margin:16px auto 0;max-width:46rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--dl-ink);text-wrap:pretty}
.cf-download-library .dl-front{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(32px,4vw,48px);align-items:start}
.cf-download-library .dl-main{min-width:0}
.cf-download-library .dl-subhead{margin:0 0 16px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--dl-subhead);text-wrap:balance}
.cf-download-library .dl-index{display:grid;gap:12px;margin-bottom:24px}
.cf-download-library .dl-search{position:relative}
.cf-download-library .dl-search-icon{position:absolute;left:18px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#ffffff));pointer-events:none}
.cf-download-library .dl-search.has-q .dl-input{padding-right:56px}
.cf-download-library .dl-input{width:100%;height:56px;margin:0;padding:0 16px 0 52px;font:inherit;font-size:1.0625rem;color:var(--field-ink,#101828);background:var(--field,#ffffff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#101828) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / 0.14));-webkit-appearance:none;appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-download-library .dl-input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#ffffff));opacity:1}
.cf-download-library .dl-input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.cf-download-library .dl-input:hover{border-color:color-mix(in oklch,var(--ink,#101828) 40%,transparent)}
.cf-download-library .dl-input:focus{outline:none;border-color:var(--dl-ring);box-shadow:0 0 0 3px oklch(from var(--dl-ring) l c h / .35)}
.cf-download-library .dl-clear{position:absolute;right:8px;top:50%;transform:translateY(-50%);width:40px;height:40px;display:grid;place-items:center;padding:0;border:0;border-radius:8px;background:transparent;color:var(--field-ink,#101828);cursor:pointer;transition:background .16s ease}
.cf-download-library .dl-clear:hover{background:color-mix(in oklch,var(--field-ink,#101828) 8%,var(--field,#ffffff))}
.cf-download-library .dl-clear:focus-visible{outline:3px solid var(--dl-ring);outline-offset:1px}
.cf-download-library .dl-chips{display:flex;flex-wrap:wrap;gap:8px}
.cf-download-library .dl-chip{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 14px;border:1px solid transparent;border-radius:999px;background:color-mix(in oklch,var(--ink,#101828) 6%,var(--surface,#ffffff));color:var(--dl-ink);font:inherit;font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap;cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .16s ease}
.cf-download-library .dl-chip:hover{background:color-mix(in oklch,var(--ink,#101828) 11%,var(--surface,#ffffff))}
.cf-download-library .dl-chip:active{transform:translateY(1px)}
.cf-download-library .dl-chip[aria-pressed="true"]{background:color-mix(in oklch,var(--accent,#1d4ed8) 12%,var(--surface,#ffffff));border-color:oklch(from var(--accent,#1d4ed8) l c h / .6)}
.cf-download-library .dl-chip[aria-pressed="true"]:hover{background:color-mix(in oklch,var(--accent,#1d4ed8) 17%,var(--surface,#ffffff))}
.cf-download-library .dl-chip:focus-visible{outline:3px solid var(--dl-ring);outline-offset:2px}
.cf-download-library .dl-chip-tick{flex:0 0 auto;color:var(--accent,#1d4ed8)}
.cf-download-library .dl-chip-n{color:var(--dl-muted);font-weight:700;font-variant-numeric:tabular-nums}
.cf-download-library .dl-count{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--dl-muted)}
.cf-download-library .dl-reset{padding:0;border:0;background:none;font:inherit;font-weight:700;color:var(--link,var(--accent,#1d4ed8));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent,#1d4ed8)) l c h / .45);text-underline-offset:.18em;cursor:pointer}
.cf-download-library .dl-reset:hover{color:oklch(from var(--link,var(--accent,#1d4ed8)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-download-library .dl-reset:focus-visible{outline:3px solid var(--dl-ring);outline-offset:2px;border-radius:4px}
.cf-download-library .dl-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(208px,1fr));gap:20px}
.cf-download-library .dl-card{position:relative;display:flex;flex-direction:column;gap:16px;min-width:0;padding:20px;background:var(--card,#ffffff);color:var(--dl-ink);border:1px solid var(--card-border,oklch(from var(--ink,#101828) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2)));transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;animation:dl-rise .45s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:calc(var(--i,0) * .07s)}
.cf-download-library .dl-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32))}
.cf-download-library .dl-card:has(.dl-btn:active){transform:translateY(-1px)}
.cf-download-library .dl-card:focus-within{border-color:oklch(from var(--dl-ring) l c h / .6)}
.cf-download-library .dl-cover{min-width:0}
.cf-download-library .dl-cover img{display:block;width:100%;height:auto;aspect-ratio:1 / 1;object-fit:cover;object-position:center;border-radius:8px;filter:drop-shadow(0 1px 2px oklch(from var(--dl-shadow) l c h / .22)) drop-shadow(0 8px 10px oklch(from var(--dl-shadow) l c h / .14));transition:transform .2s ease,opacity .2s ease}
.cf-download-library .dl-pick-cover img{display:block;width:100%;height:auto;aspect-ratio:4 / 3;object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px oklch(from var(--dl-shadow) l c h / .28)) drop-shadow(0 12px 14px oklch(from var(--dl-shadow) l c h / .2))}
.cf-download-library .dl-card.is-wait .dl-cover img{opacity:.7}
.cf-download-library .dl-card:hover .dl-cover img{transform:translateY(-4px) scale(1.02)}
.cf-download-library .dl-card-body{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0}
.cf-download-library .dl-tags{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.cf-download-library .dl-tag{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink,#101828) 6%,var(--card,#ffffff));color:var(--dl-ink);font-size:.875rem;font-weight:800;line-height:1.2;transition:background .16s ease}
.cf-download-library .dl-tag.is-on{background:color-mix(in oklch,var(--accent,#1d4ed8) 14%,var(--card,#ffffff))}
.cf-download-library .dl-title{margin:4px 0 0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.15;text-wrap:balance;overflow-wrap:break-word}
.cf-download-library .dl-detail{margin:0;font-size:.9375rem;line-height:1.4;color:var(--dl-muted);text-wrap:pretty}
.cf-download-library .dl-meta{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--dl-muted);font-variant-numeric:tabular-nums}
.cf-download-library .dl-status{margin:0;color:var(--warning,#92400e);font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
.cf-download-library .dl-status svg{display:inline-block;vertical-align:-.2em;margin-inline-end:.4em}
.cf-download-library .dl-act{margin-top:auto;padding-top:8px}
.cf-download-library .dl-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:56px;margin:0;padding:8px 20px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--dl-btn) calc(l + .04) c h),oklch(from var(--dl-btn-2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#ffffff));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:1.125rem;line-height:1.15;text-align:center;text-decoration:none;text-wrap:balance;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--dl-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--dl-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--dl-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--dl-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-download-library .dl-btn:hover,.cf-download-library .dl-btn.is-hover{background:linear-gradient(oklch(from var(--dl-btn) calc(l - .01) c h),oklch(from var(--dl-btn-2) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--dl-btn) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--dl-btn) calc(l - .2) c h),0 1px 2px oklch(from var(--dl-shadow) l c h / .34),0 10px 18px -6px oklch(from var(--dl-shadow) l c h / .55))}
.cf-download-library .dl-btn:active,.cf-download-library .dl-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--dl-btn) calc(l - .05) c h),oklch(from var(--dl-btn-2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--dl-btn) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--dl-btn) calc(l - .16) c h),0 1px 1px oklch(from var(--dl-shadow) l c h / .3)}
.cf-download-library .dl-btn:focus-visible{outline:3px solid var(--dl-ring);outline-offset:3px}
.cf-download-library .dl-btn:disabled{background:color-mix(in oklch,var(--ink,#101828) 7%,var(--card,#ffffff));color:var(--dl-muted);border:1px solid oklch(from var(--ink,#101828) l c h / .16);box-shadow:none;text-shadow:none;cursor:not-allowed;transform:none}
.cf-download-library .dl-btn--big{min-height:64px;margin-top:4px;padding:10px 20px}
.cf-download-library .dl-btn--ghost{width:auto;margin-top:12px;padding:8px 28px;background:var(--button-2-bg,var(--secondary,#eef0f4));color:var(--button-2-ink,var(--secondary-ink,#101828));border:1px solid var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / .18)));text-shadow:none}
.cf-download-library .dl-btn--ghost:hover{background:oklch(from var(--button-2-bg,var(--secondary,#eef0f4)) calc(l - .04) c h);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / .18)))}
.cf-download-library .dl-btn--ghost:active{background:oklch(from var(--button-2-bg,var(--secondary,#eef0f4)) calc(l - .07) c h);box-shadow:none}
.cf-download-library .dl-pick{display:flex;flex-direction:column;gap:20px;padding:24px;background:var(--card,#ffffff);color:var(--dl-ink);border:1px solid color-mix(in oklch,var(--accent,#1d4ed8) 34%,var(--card,#ffffff));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32));animation:dl-rise .45s cubic-bezier(.2,.7,.2,1) .14s backwards}
.cf-download-library .dl-pick-cover{min-width:0}
.cf-download-library .dl-pick-body{display:flex;flex-direction:column;gap:12px;min-width:0}
.cf-download-library .dl-pick-title{margin:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-download-library .dl-pick-detail{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--dl-muted);text-wrap:pretty}
.cf-download-library .dl-coupon{margin:4px 0 0;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#ffffff));color:var(--dl-ink);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-download-library .dl-coupon svg{display:inline-block;vertical-align:-.2em;margin-inline-end:.4em;color:var(--dl-subhead)}
.cf-download-library .dl-coupon-save{font-weight:800}
.cf-download-library .dl-coupon-code{display:block;margin-top:2px;color:var(--dl-muted)}
.cf-download-library .dl-coupon-code b{color:var(--dl-ink);font-weight:800;letter-spacing:.08em;-webkit-user-select:all;user-select:all}
.cf-download-library .dl-price{margin:4px 0 0;display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px}
.cf-download-library .dl-now{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-download-library .dl-price s{font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:700;color:var(--dl-muted);text-decoration-color:var(--danger,#b42318);text-decoration-thickness:2px;font-variant-numeric:tabular-nums}
.cf-download-library .dl-pick-note{margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--dl-muted);text-align:center;text-wrap:pretty}
.cf-download-library .dl-empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:40px 24px;text-align:center;border-radius:14px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--surface,#ffffff));animation:dl-rise .45s cubic-bezier(.2,.7,.2,1) backwards}
.cf-download-library .dl-empty-title{margin:4px 0 0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.15;text-wrap:balance}
.cf-download-library .dl-empty-hint{margin:0;max-width:40rem;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--dl-muted);text-wrap:pretty}
.cf-download-library .dl-spin{animation:dl-spin .8s linear infinite}
@keyframes dl-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes dl-spin{to{transform:rotate(360deg)}}
@media (min-width:1024px){
.cf-download-library .dl-front.has-pick{grid-template-columns:minmax(0,1fr) 368px}
.cf-download-library .dl-rail{position:sticky;top:24px}
}
@media (min-width:640px) and (max-width:1023px){
.cf-download-library .dl-pick{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);align-items:start;gap:24px}
}
@media (max-width:639px){
.cf-download-library .dl-plate{grid-template-columns:minmax(0,1fr);justify-items:center;gap:4px;padding-bottom:12px}
.cf-download-library .dl-name{order:-1;margin-bottom:4px}
.cf-download-library .dl-date--l,.cf-download-library .dl-date--r{text-align:center}
.cf-download-library .dl-date:empty{display:none}
.cf-download-library .dl-headline{margin-top:24px}
.cf-download-library .dl-chip{padding:0 12px}
.cf-download-library .dl-input{padding-left:46px}
.cf-download-library .dl-search-icon{left:14px}
.cf-download-library .dl-grid{grid-template-columns:minmax(0,1fr);gap:12px}
.cf-download-library .dl-card{display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:16px}
.cf-download-library .dl-card.has-cover{grid-template-columns:84px minmax(0,1fr);column-gap:16px}
.cf-download-library .dl-cover{align-self:start}
.cf-download-library .dl-detail{display:none}
.cf-download-library .dl-title{margin-top:0;font-size:1.125rem}
.cf-download-library .dl-btn--card{min-height:48px;font-size:1.0625rem}
.cf-download-library .dl-pick{padding:20px}
.cf-download-library .dl-empty{padding:32px 20px}
}
@media (prefers-reduced-motion:reduce){
.cf-download-library *,.cf-download-library *::before,.cf-download-library *::after{animation:none !important;transition:none !important}
.cf-download-library .dl-card:hover,.cf-download-library .dl-card:has(.dl-btn:active),.cf-download-library .dl-card:hover .dl-cover img,.cf-download-library .dl-btn:active,.cf-download-library .dl-btn.is-active,.cf-download-library .dl-chip:active{transform:none}
}
`;
pieces/checkout/download-library/specimen.tsx 99 lines
import __studioImagecb070371 from "../assets/dfacfc41ace42e02.webp";
import __studioImage98a28428 from "../assets/30c3a3d2b98b5650.webp";
import __studioImage763d3a29 from "../assets/0b667857c5542c78.webp";
// Specimen: a Brightpath Templates customer's shelf with five templates (one still processing) and one paid pick.
import * as React from "react";
import { DownloadLibrary } from "../download-library";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled"];
type State = "default" | "hover" | "active" | "disabled";
export default function DownloadLibrarySpecimen({ state = "default" }: { state?: State }) {
const [guide, workbook, checklist] = defaults.sample.items;
return (
<DownloadLibrary
state={state}
storeName="Brightpath Templates"
dateline="Updated November 21, 2026"
shelfValue="$163"
products={[
{
id: "planning-guide",
title: guide.name,
detail: guide.detail,
image: slot("item-1", guide.image),
imageAlt: guide.imageAlt,
formats: ["PDF"],
files: 1,
size: "12.4 MB",
},
{
id: "copy-workbook",
title: workbook.name,
detail: workbook.detail,
image: slot("item-2", workbook.image),
imageAlt: workbook.imageAlt,
formats: ["PDF", "Notion"],
files: 2,
size: "8.1 MB",
},
{
id: "launch-checklist",
title: checklist.name,
detail: checklist.detail,
image: slot("item-3", checklist.image),
imageAlt: checklist.imageAlt,
formats: ["PDF", "Notion"],
files: 2,
size: "2.3 MB",
},
{
id: "sales-wireframes",
title: "Sales Page Wireframes",
detail: "Five sales page layouts, ready for your copy.",
image: slot(
"item-4",
__studioImagecb070371,
),
imageAlt: "Tablet showing a sales page wireframe",
formats: ["Figma", "PDF"],
files: 3,
size: "46.2 MB",
},
{
id: "email-vault",
title: "Email Swipe Vault",
detail: "Thirty launch emails to copy, tweak and send.",
image: slot(
"item-5",
__studioImage98a28428,
),
imageAlt: "Fanned stack of printed email templates",
formats: ["Notion", "PDF"],
files: 2,
size: "4.8 MB",
status: "processing",
},
]}
pick={{
title: "Promo Graphics Pack",
detail: "Twenty-four social and ad graphics sized for every launch post.",
image: slot(
"item-6",
__studioImage763d3a29,
),
imageAlt: "Fanned set of social media graphic templates",
formats: ["Figma", "PDF"],
price: "$19",
regularPrice: "$29",
saving: "Shelf customers save $10",
code: "SHELF10",
label: "Yes! I want the Promo Pack",
note: "One payment · Lands on this shelf",
}}
/>
);
}
| Name | Type | Details |
|---|---|---|
storeName OptionalDownloadLibrary |
string |
|
dateline OptionalDownloadLibrary |
string |
|
shelfValue OptionalDownloadLibrary |
string |
|
headline OptionalDownloadLibrary |
string |
|
highlight OptionalDownloadLibrary |
string |
|
lead OptionalDownloadLibrary |
string |
|
shelfHeading OptionalDownloadLibrary |
string |
|
products OptionalDownloadLibrary |
LibraryProduct[] |
|
pickHeading OptionalDownloadLibrary |
string |
|
pick OptionalDownloadLibrary |
LibraryPick |
|
onDownload OptionalDownloadLibrary |
(product: LibraryProduct) => void |
|
onAction OptionalDownloadLibrary |
() => void |
|
copy OptionalDownloadLibrary |
Partial<DownloadLibraryCopy> |
|
state OptionalDownloadLibrary |
"default" | "hover" | "active" | "disabled" |
|
className OptionalDownloadLibrary |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-4- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-5- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-6- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
0b667857c5542c78.webp
image/webp · 37.7 KB
-
30c3a3d2b98b5650.webp
image/webp · 69 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
dfacfc41ace42e02.webp
image/webp · 23.2 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB