Customer Portal 1
Customer center block: one itemised account ledger (orders, files, membership, support) that totals up and ends in the download action, so buyers reach what they paid for fast and stay sold.
Use it in a prompt
Use checkout/customer-portal 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/customer-portal.tsx. - Import it and pass your copy and images (Props tab):
import { CustomerPortal } from "@/components/funneldna/checkout/customer-portal"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/customer-portal/component.tsx 672 lines
// layout: ledger-receipt
// Customer center block: one itemised account ledger (orders, files, membership, support) that totals up and ends in the download action, so buyers reach what they paid for fast and stay sold.
import * as React from "react";
import { AlertCircle, CalendarClock, Check, ChevronDown, CreditCard, FileText, Loader2, Mail, User } from "lucide-react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
export type PortalOrderStatus = "paid" | "pending" | "refunded" | "failed";
export type PortalMembershipStatus = "active" | "paused" | "cancelled";
export type PortalOrder = {
id: string; // order number shown on the statement
date: string;
title: string;
status: PortalOrderStatus;
amount: string;
lines?: { label: React.ReactNode; value: string }[]; // receipt lines revealed when the row opens
payment?: string; // e.g. "Visa ending 4242"
};
export type PortalDownload = {
name: string;
detail?: string;
format?: string; // file type chip, e.g. "PDF"
image?: string; // item-n slot image
imageAlt?: string;
href?: string; // direct file link; without it the row calls onDownload
ready?: boolean; // false while the file is still being prepared
};
export type PortalMembership = {
name: string;
status?: PortalMembershipStatus;
renews: string; // next billing date
price: string;
perDay?: string; // supplied per-day breakdown shown under the price
manageHref?: string;
};
export type PortalSupport = {
email: string;
note?: string;
image?: string; // scene slot image
imageAlt?: string;
href?: string; // support form or help desk link; without it the button calls onSupport
};
export type CustomerPortalCopy = {
account: string; // "{name}" placeholder
ordersTitle: string;
ordersNote: string; // "{count}" placeholder
ordersNoteOne: string;
orderNumber: string; // "{id}" placeholder
paidWith: string;
receiptTotal: string;
receiptLink: string;
downloadsTitle: string;
downloadsNote: string;
downloadLabel: string;
downloadAria: string; // "{name}" placeholder
preparingLabel: string;
membershipTitle: string;
membershipNote: string;
renews: string; // "{date}" placeholder
manageLabel: string;
supportTitle: string;
supportNote: string;
supportLabel: string;
totalLabel: string;
commitError: string;
status: Record<PortalOrderStatus, string>;
membershipStatus: Record<PortalMembershipStatus, string>;
};
export type CustomerPortalCopyInput = Partial<Omit<CustomerPortalCopy, "status" | "membershipStatus">> & {
status?: Partial<Record<PortalOrderStatus, string>>;
membershipStatus?: Partial<Record<PortalMembershipStatus, string>>;
};
export type CustomerPortalProps = {
headline?: string;
highlight?: string; // phrase inside the headline that gets the marker stroke
lead?: string;
productImage?: string; // product slot: transparent cut-out that rests on the ledger's top edge
productImageAlt?: string;
customerName?: string;
customerEmail?: string;
orders?: PortalOrder[];
defaultOpenOrder?: string; // order id whose receipt starts open
downloads?: PortalDownload[];
membership?: PortalMembership;
support?: PortalSupport;
total?: string; // bold total line, e.g. paid to date
totalNote?: string;
commitLabel?: string; // ticked commitment line above the button
actionLabel?: string;
actionNote?: string;
href?: string;
onAction?: () => void;
onDownload?: (item: PortalDownload, index: number) => void;
onReceipt?: (order: PortalOrder) => void;
onManage?: (membership: PortalMembership) => void;
onSupport?: (support: PortalSupport) => void;
actionDisabled?: boolean;
copy?: CustomerPortalCopyInput;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
const DEFAULT_COPY: CustomerPortalCopy = {
account: "Account for {name}",
ordersTitle: "Every order, itemised to the cent",
ordersNote: "{count} orders on your statement",
ordersNoteOne: "1 order on your statement",
orderNumber: "Order {id}",
paidWith: "Paid with",
receiptTotal: "Order total",
receiptLink: "Download receipt",
downloadsTitle: "Download your files whenever you need them",
downloadsNote: "Grab them as often as you like.",
downloadLabel: "Download",
downloadAria: "Download {name}",
preparingLabel: "Preparing",
membershipTitle: "Your membership, on your terms",
membershipNote: "Update your card or change your plan from one page.",
renews: "Renews {date}",
manageLabel: "Manage membership",
supportTitle: "Need a hand? We're one email away",
supportNote: "Reply to any order email or write to us directly.",
supportLabel: "Message Support",
totalLabel: "Paid to date",
commitError: "Tick the box above to confirm, then download your files.",
status: { paid: "Paid", pending: "Pending", refunded: "Refunded", failed: "Payment failed" },
membershipStatus: { active: "Active", paused: "Paused", cancelled: "Cancelled" },
};
const STATUS_TONE: Record<PortalOrderStatus, string> = {
paid: "cp-chip--ok",
pending: "cp-chip--warn",
refunded: "",
failed: "cp-chip--bad",
};
const MEMBERSHIP_TONE: Record<PortalMembershipStatus, string> = {
active: "cp-chip--ok",
paused: "cp-chip--warn",
cancelled: "",
};
export function CustomerPortal(props: CustomerPortalProps) {
const {
headline = "Everything you own, ready when you are",
highlight = "ready when you are",
lead = "Download your files, check every receipt and manage your membership from one page. No emails, no waiting.",
productImage,
productImageAlt = "",
customerName,
customerEmail,
orders = [],
defaultOpenOrder,
downloads = [],
membership,
support,
total,
totalNote,
commitLabel = "I understand I'm covered by the money-back guarantee",
actionLabel = "Download Everything",
actionNote = "Every file in one download",
href,
onAction,
onDownload,
onReceipt,
onManage,
onSupport,
actionDisabled = false,
copy: copyIn,
state = "default",
className,
} = props;
const copy: CustomerPortalCopy = {
...DEFAULT_COPY,
...copyIn,
status: { ...DEFAULT_COPY.status, ...copyIn?.status },
membershipStatus: { ...DEFAULT_COPY.membershipStatus, ...copyIn?.membershipStatus },
};
const uid = React.useId().replace(/:/g, "");
const reduce = useReducedMotion();
const [openId, setOpenId] = React.useState<string | null>(defaultOpenOrder ?? null);
const [checked, setChecked] = React.useState(state !== "error");
const [attempted, setAttempted] = React.useState(state === "error");
const boxRef = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
setChecked(state !== "error");
setAttempted(state === "error");
}, [state]);
const disabled = actionDisabled || state === "disabled";
const showError = attempted && !checked;
const errId = `${uid}-err`;
const handleAction = (event: React.MouseEvent) => {
if (disabled) {
event.preventDefault();
return;
}
if (!checked) {
event.preventDefault();
setAttempted(true);
boxRef.current?.focus();
return;
}
onAction?.();
};
const ctaClass = ["cp-cta", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""]
.filter(Boolean)
.join(" ");
const rootClass = ["cf-customer-portal", productImage ? "has-art" : "", className].filter(Boolean).join(" ");
const hasSummary = Boolean(total || totalNote);
return (
<section className={rootClass} aria-labelledby={`${uid}-h`}>
<style>{CSS}</style>
<div className="cp-wrap">
<header className="cp-head">
<div className="cp-headtext">
<h2 id={`${uid}-h`} className="cp-h2">
<Highlighted text={headline} phrase={highlight} />
</h2>
{lead ? <p className="cp-lead">{lead}</p> : null}
</div>
{productImage ? (
<img className="cp-heroimg" src={productImage} alt={productImageAlt} width={400} height={400} />
) : null}
</header>
<div className="cp-card">
{customerName || customerEmail ? (
<p className="cp-acct">
<User className="cp-ic" aria-hidden strokeWidth={2.5} />
{customerName ? fill(copy.account, { name: customerName }) : null}
{customerName && customerEmail ? <span aria-hidden="true"> · </span> : null}
{customerEmail}
</p>
) : null}
{orders.length ? (
<section className="cp-sec" aria-labelledby={`${uid}-o`}>
<div className="cp-shead">
<h3 id={`${uid}-o`} className="cp-h3">
{copy.ordersTitle}
</h3>
<p className="cp-snote">
{orders.length === 1 ? copy.ordersNoteOne : fill(copy.ordersNote, { count: String(orders.length) })}
</p>
</div>
<ul className="cp-list">
{orders.map((order, i) => {
const open = openId === order.id;
const panelId = `${uid}-r${i}`;
return (
<li key={order.id} className="cp-order cp-rv" style={rv(i)}>
<button
type="button"
className="cp-orow"
aria-expanded={open}
aria-controls={panelId}
onClick={() => setOpenId(open ? null : order.id)}
>
<span className="cp-date">{order.date}</span>
<span className="cp-who">
<span className="cp-name">{order.title}</span>
<span className="cp-meta">
<span className="cp-mdate">{order.date} · </span>
{fill(copy.orderNumber, { id: order.id })}
</span>
</span>
<span className="cp-leader" aria-hidden="true" />
<span className={`cp-chip ${STATUS_TONE[order.status]}`}>{copy.status[order.status]}</span>
<span className="cp-amt">{order.amount}</span>
<ChevronDown className="cp-chev" aria-hidden strokeWidth={2.5} />
</button>
<AnimatePresence initial={false}>
{open ? (
<motion.div
key="receipt"
id={panelId}
className="cp-receipt"
initial={reduce ? false : { height: 0, opacity: 0 }}
animate={{ height: "auto", opacity: 1 }}
exit={reduce ? { opacity: 0, transition: { duration: 0 } } : { height: 0, opacity: 0 }}
transition={{ duration: reduce ? 0 : 0.28, ease: [0.2, 0.7, 0.2, 1] }}
>
<div className="cp-well">
{(order.lines ?? []).map((line, j) => (
<div className="cp-line" key={j}>
<span className="cp-line-l">{line.label}</span>
<span className="cp-leader" aria-hidden="true" />
<span className="cp-line-v">{line.value}</span>
</div>
))}
{order.payment ? (
<div className="cp-line cp-line--pay">
<span className="cp-line-l">
<CreditCard className="cp-ic" aria-hidden strokeWidth={2.5} />
{copy.paidWith} {order.payment}
</span>
</div>
) : null}
<div className="cp-line cp-line--total">
<span className="cp-line-l">{copy.receiptTotal}</span>
<span className="cp-leader" aria-hidden="true" />
<span className="cp-line-v">{order.amount}</span>
</div>
<button type="button" className="cp-link cp-rlink" onClick={() => onReceipt?.(order)}>
<FileText className="cp-ic" aria-hidden strokeWidth={2.5} />
{copy.receiptLink}
</button>
</div>
</motion.div>
) : null}
</AnimatePresence>
</li>
);
})}
</ul>
</section>
) : null}
{downloads.length ? (
<section className="cp-sec" aria-labelledby={`${uid}-d`}>
<div className="cp-shead">
<h3 id={`${uid}-d`} className="cp-h3">
{copy.downloadsTitle}
</h3>
{copy.downloadsNote ? <p className="cp-snote">{copy.downloadsNote}</p> : null}
</div>
<ul className="cp-list">
{downloads.map((item, i) => {
const ready = item.ready !== false;
const label = fill(copy.downloadAria, { name: item.name });
return (
<li key={`${item.name}-${i}`} className={"cp-drow cp-rv" + (item.image ? "" : " cp-drow--plain")} style={rv(i)}>
{item.image ? (
<img className="cp-thumb" src={item.image} alt={item.imageAlt ?? ""} width={64} height={64} loading="lazy" />
) : null}
<span className="cp-who">
<span className="cp-name">
{item.name}
{item.format ? <span className="cp-chip cp-chip--inline">{item.format}</span> : null}
</span>
{item.detail ? <span className="cp-meta">{item.detail}</span> : null}
</span>
<span className="cp-leader" aria-hidden="true" />
{!ready ? (
<button type="button" className="cp-btn2" disabled>
<Loader2 className="cp-spin" aria-hidden strokeWidth={2.5} />
{copy.preparingLabel}
</button>
) : item.href ? (
<a className="cp-btn2" href={item.href} download aria-label={label}>
{copy.downloadLabel}
</a>
) : (
<button type="button" className="cp-btn2" aria-label={label} onClick={() => onDownload?.(item, i)}>
{copy.downloadLabel}
</button>
)}
</li>
);
})}
</ul>
</section>
) : null}
{membership ? (
<section className="cp-sec" aria-labelledby={`${uid}-m`}>
<div className="cp-shead">
<h3 id={`${uid}-m`} className="cp-h3">
{copy.membershipTitle}
</h3>
{copy.membershipNote ? <p className="cp-snote">{copy.membershipNote}</p> : null}
</div>
<div className="cp-mem cp-rv">
<div className="cp-memtop">
<span className="cp-who">
<span className="cp-name">
{membership.name}
{membership.status ? (
<span className={`cp-chip cp-chip--inline ${MEMBERSHIP_TONE[membership.status]}`}>
{copy.membershipStatus[membership.status]}
</span>
) : null}
</span>
<span className="cp-meta">
<CalendarClock className="cp-ic" aria-hidden strokeWidth={2.5} />
{fill(copy.renews, { date: membership.renews })}
</span>
</span>
<span className="cp-leader" aria-hidden="true" />
<span className="cp-price">
<span className="cp-pricev">{membership.price}</span>
{membership.perDay ? <span className="cp-perday">{membership.perDay}</span> : null}
</span>
</div>
<p className="cp-memact">
{membership.manageHref ? (
<a className="cp-link" href={membership.manageHref}>
{copy.manageLabel}
</a>
) : (
<button type="button" className="cp-link" onClick={() => onManage?.(membership)}>
{copy.manageLabel}
</button>
)}
</p>
</div>
</section>
) : null}
{support ? (
<section className="cp-sec" aria-labelledby={`${uid}-s`}>
<div className="cp-shead">
<h3 id={`${uid}-s`} className="cp-h3">
{copy.supportTitle}
</h3>
</div>
<div className={"cp-sup cp-rv" + (support.image ? "" : " cp-sup--text")}>
{support.image ? (
<img className="cp-supimg" src={support.image} alt={support.imageAlt ?? ""} width={400} height={300} loading="lazy" />
) : null}
<div className="cp-suptext">
<a className="cp-link cp-email" href={`mailto:${support.email}`}>
<Mail className="cp-ic" aria-hidden strokeWidth={2.5} />
{support.email}
</a>
<p className="cp-supnote">{support.note ?? copy.supportNote}</p>
{support.href ? (
<a className="cp-btn2" href={support.href}>
{copy.supportLabel}
</a>
) : (
<button type="button" className="cp-btn2" onClick={() => onSupport?.(support)}>
{copy.supportLabel}
</button>
)}
</div>
</div>
</section>
) : null}
<div className={"cp-foot" + (hasSummary ? "" : " cp-foot--solo")}>
{hasSummary ? (
<div className="cp-sum">
{total ? (
<div className="cp-total">
<span className="cp-tlabel">{copy.totalLabel}</span>
<span className="cp-leader" aria-hidden="true" />
<span className="cp-tval">{total}</span>
</div>
) : null}
{totalNote ? <p className="cp-tnote">{totalNote}</p> : null}
</div>
) : null}
<div className="cp-act">
<label className={"cp-commit" + (showError ? " is-error" : "")}>
<input
ref={boxRef}
type="checkbox"
className="cp-cbox"
checked={checked}
onChange={(event) => setChecked(event.target.checked)}
aria-invalid={showError || undefined}
aria-describedby={showError ? errId : undefined}
/>
<span className="cp-box" aria-hidden="true">
<Check strokeWidth={3} />
</span>
<span className="cp-commit-t">{commitLabel}</span>
</label>
{showError ? (
<p className="cp-err" id={errId} role="alert">
<AlertCircle className="cp-ic" aria-hidden strokeWidth={2.5} />
{copy.commitError}
</p>
) : null}
{href && !disabled ? (
<a className={ctaClass} href={href} onClick={handleAction} aria-describedby={showError ? errId : undefined}>
{actionLabel}
</a>
) : (
<button
type="button"
className={ctaClass}
disabled={disabled}
onClick={handleAction}
aria-describedby={showError ? errId : undefined}
>
{actionLabel}
</button>
)}
{actionNote ? <p className="cp-anote">{actionNote}</p> : null}
</div>
</div>
</div>
</div>
</section>
);
}
export default CustomerPortal;
function Highlighted({ text, phrase }: { text: string; phrase?: string }) {
const at = phrase ? text.indexOf(phrase) : -1;
if (!phrase || at < 0) return <>{text}</>;
return (
<>
{text.slice(0, at)}
<mark className="cp-mark">{phrase}</mark>
{text.slice(at + phrase.length)}
</>
);
}
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((out, key) => out.split("{" + key + "}").join(vars[key]), template);
}
function rv(i: number) {
return { "--i": Math.min(i, 4) } as React.CSSProperties;
}
const CSS = `
.cf-customer-portal{--cp-hair:oklch(from var(--ink) l c h / .14);--cp-rule:oklch(from var(--ink) l c h / .22);--cp-well:color-mix(in oklch, var(--ink) 4%, var(--card));--cp-pad:clamp(20px, 3vw, 32px);--cp-ease:cubic-bezier(.2,.7,.2,1);--cp-ring:oklch(from var(--field-focus, var(--accent)) l c h / .55);--cp-shadow:var(--shadow, oklch(.22 .03 260));--cp-btn:var(--button-bg, var(--cta));--cp-btn-2:var(--button-bg-2, var(--cta-2));display:block;background:var(--surface);color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5;padding:clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);overflow-x:clip}
.cf-customer-portal *,.cf-customer-portal *::before,.cf-customer-portal *::after{box-sizing:border-box}
.cf-customer-portal img{max-width:100%}
.cf-customer-portal .cp-wrap{max-width:1120px;margin:0 auto}
.cf-customer-portal .cp-head{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);gap:clamp(32px, 5vw, 72px);align-items:start}
.cf-customer-portal .cp-headtext{padding-bottom:clamp(24px, 4vw, 40px)}
.cf-customer-portal .cp-h2{margin:0 0 16px;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;color:var(--ink);text-wrap:balance}
.cf-customer-portal .cp-mark{color:inherit;background:linear-gradient(180deg, transparent 0 50%, color-mix(in oklch, var(--marker, #fae37c) 78%, transparent) 50% 92%, transparent 92%);padding:0 .1em;margin:0 -.04em;border-radius:.18em .32em .22em .4em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-customer-portal .cp-lead{margin:0;max-width:56ch;font-size:clamp(1.125rem, 1.5vw, 1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-customer-portal .cp-heroimg{position:relative;z-index:2;display:block;justify-self:end;width:100%;max-width:400px;height:auto;aspect-ratio:1;object-fit:contain;margin-bottom:calc(-1 * clamp(40px, 5vw, 64px));pointer-events:none;filter:drop-shadow(0 2px 3px oklch(from var(--cp-shadow) l c h / .28)) drop-shadow(0 14px 18px oklch(from var(--cp-shadow) l c h / .22))}
.cf-customer-portal .cp-card{position:relative;z-index:1;overflow:hidden;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-lg, 0 2px 4px oklch(from var(--cp-shadow) l c h / .22), 0 12px 24px -8px oklch(from var(--cp-shadow) l c h / .32)));padding:var(--cp-pad) var(--cp-pad) 0}
.cf-customer-portal .cp-acct{margin:0 0 8px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty;overflow-wrap:anywhere}
.cf-customer-portal.has-art .cp-acct{padding-right:min(36%, 340px)}
.cf-customer-portal .cp-ic{display:inline-block;width:1em;height:1em;vertical-align:-.15em;margin-inline-end:.4em;flex:none}
.cf-customer-portal .cp-sec{display:grid;grid-template-columns:minmax(0,15rem) minmax(0,1fr);gap:clamp(24px, 4vw, 48px);align-items:start;padding:32px 0}
.cf-customer-portal .cp-sec + .cp-sec{border-top:1px solid var(--cp-hair)}
.cf-customer-portal .cp-h3{margin:0 0 8px;font-family:var(--font-display);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(--ink);text-wrap:balance}
.cf-customer-portal .cp-snote{margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-customer-portal .cp-list{list-style:none;margin:0;padding:0}
.cf-customer-portal .cp-who{display:flex;flex-direction:column;gap:2px;min-width:0;flex:0 1 auto}
.cf-customer-portal .cp-name{font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.35;font-weight:700;color:var(--ink);text-wrap:pretty}
.cf-customer-portal .cp-meta{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-customer-portal .cp-mdate{display:none}
.cf-customer-portal .cp-leader{flex:1 1 1.5rem;min-width:1.5rem;height:1px;background:var(--cp-rule)}
.cf-customer-portal .cp-chip{display:inline-flex;align-items:center;flex:none;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 6%, var(--card));color:var(--ink);font-family:var(--font-body);font-size:.875rem;line-height:1.2;font-weight:800;white-space:nowrap}
.cf-customer-portal .cp-chip--inline{margin-left:10px;vertical-align:.1em}
.cf-customer-portal .cp-chip--ok{background:var(--success-soft);color:var(--success)}
.cf-customer-portal .cp-chip--warn{background:var(--warning-soft);color:var(--warning)}
.cf-customer-portal .cp-chip--bad{background:var(--danger-soft);color:var(--danger)}
.cf-customer-portal .cp-order + .cp-order{border-top:1px solid var(--cp-hair)}
.cf-customer-portal .cp-orow{display:flex;align-items:center;gap:16px;width:calc(100% + 24px);margin:0 -12px;padding:14px 12px;border:0;border-radius:clamp(6px, var(--button-radius, var(--radius, 10px)), 10px);background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color .16s ease}
.cf-customer-portal .cp-orow:hover{background:var(--cp-well)}
.cf-customer-portal .cp-orow:focus-visible{outline:3px solid var(--cp-ring);outline-offset:0}
.cf-customer-portal .cp-date{flex:0 0 7.25rem;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.cf-customer-portal .cp-amt{flex:none;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-customer-portal .cp-chev{flex:none;width:20px;height:20px;color:var(--muted);transition:transform .2s var(--cp-ease)}
.cf-customer-portal .cp-orow[aria-expanded="true"] .cp-chev{transform:rotate(180deg)}
.cf-customer-portal .cp-receipt{overflow:hidden}
.cf-customer-portal .cp-well{margin:4px 0 16px;padding:16px 20px;border-radius:10px;background:var(--cp-well)}
.cf-customer-portal .cp-line{display:flex;align-items:center;gap:12px;padding:6px 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--ink)}
.cf-customer-portal .cp-line .cp-leader{background:oklch(from var(--ink) l c h / .16)}
.cf-customer-portal .cp-line-l{min-width:0;text-wrap:pretty}
.cf-customer-portal .cp-line-v{flex:none;font-weight:700;font-variant-numeric:tabular-nums}
.cf-customer-portal .cp-line--pay{color:var(--muted)}
.cf-customer-portal .cp-line--total{padding-top:12px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);font-weight:800}
.cf-customer-portal .cp-line--total .cp-line-v{font-weight:800}
.cf-customer-portal .cp-link{display:inline;margin:0;padding:0;border:0;background:none;font:inherit;font-weight:min(var(--button-weight, 800), 700);color:var(--link, var(--accent));text-decoration:underline;text-decoration-thickness:1px;text-decoration-color:oklch(from var(--link, var(--accent)) l c h / .45);text-underline-offset:.18em;cursor:pointer;transition:color .16s ease}
.cf-customer-portal .cp-link:hover{color:oklch(from var(--link, var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-customer-portal .cp-link:focus-visible{outline:3px solid var(--cp-ring);outline-offset:3px;border-radius:4px}
.cf-customer-portal .cp-well .cp-link{color:oklch(from var(--link, var(--accent)) calc(l - .05) c h);text-decoration-color:oklch(from var(--link, var(--accent)) calc(l - .05) c h / .45)}
.cf-customer-portal .cp-well .cp-link:hover{color:oklch(from var(--link, var(--accent)) calc(l - .12) c h);text-decoration-color:currentColor}
.cf-customer-portal .cp-rlink{display:inline-block;margin-top:10px;font-size:.9375rem}
.cf-customer-portal .cp-drow{display:flex;align-items:center;gap:16px;padding:14px 0}
.cf-customer-portal .cp-drow + .cp-drow{border-top:1px solid var(--cp-hair)}
.cf-customer-portal .cp-thumb{flex:none;display:block;width:64px;height:64px;border-radius:8px;object-fit:cover;object-position:center}
.cf-customer-portal .cp-btn2{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;margin:0;padding:0 22px;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);font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.15;text-transform:var(--button-case, none);text-decoration:none;white-space:nowrap;cursor:pointer;transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease}
.cf-customer-portal .cp-btn2:hover{background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - .04) c h)}
.cf-customer-portal .cp-btn2:active{transform:translateY(1px);box-shadow:none}
.cf-customer-portal .cp-btn2:focus-visible{outline:3px solid var(--cp-ring);outline-offset:3px}
.cf-customer-portal .cp-btn2:disabled{cursor:not-allowed;opacity:.72;transform:none}
.cf-customer-portal .cp-btn2:disabled:hover{background:var(--button-2-bg, var(--secondary))}
.cf-customer-portal .cp-spin{width:18px;height:18px;animation:cp-spin .8s linear infinite}
.cf-customer-portal .cp-memtop{display:flex;align-items:center;gap:16px}
.cf-customer-portal .cp-price{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px;text-align:right}
.cf-customer-portal .cp-pricev{font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-customer-portal .cp-perday{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-customer-portal .cp-memact{margin:12px 0 0}
.cf-customer-portal .cp-sup{display:grid;grid-template-columns:200px minmax(0,1fr);gap:24px;align-items:start}
.cf-customer-portal .cp-sup--text{grid-template-columns:minmax(0,1fr)}
.cf-customer-portal .cp-supimg{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;object-position:center;border-radius:12px}
.cf-customer-portal .cp-email{overflow-wrap:anywhere}
.cf-customer-portal .cp-suptext{min-width:0}
.cf-customer-portal .cp-supnote{margin:8px 0 16px;max-width:60ch;color:var(--muted);text-wrap:pretty}
.cf-customer-portal .cp-suptext .cp-btn2{display:flex;width:100%;max-width:100%}
.cf-customer-portal .cp-foot{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,26rem);gap:clamp(24px, 4vw, 48px);align-items:start;margin:8px calc(-1 * var(--cp-pad)) 0;padding:clamp(28px, 4vw, 40px) var(--cp-pad);background:var(--cp-well)}
.cf-customer-portal .cp-foot--solo{grid-template-columns:minmax(0,26rem);justify-content:end}
.cf-customer-portal .cp-total{display:flex;align-items:flex-end;gap:16px}
.cf-customer-portal .cp-tlabel{flex:none;font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--ink)}
.cf-customer-portal .cp-total .cp-leader{margin-bottom:.5em;background:oklch(from var(--ink) l c h / .3)}
.cf-customer-portal .cp-tval{flex:none;font-family:var(--font-display);font-weight:var(--display-weight, 800);font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1;letter-spacing:-0.03em;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-customer-portal .cp-tnote{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--ink);text-align:right;text-wrap:pretty}
.cf-customer-portal .cp-commit{position:relative;display:flex;align-items:flex-start;gap:12px;margin:0 0 16px;font-weight:600;line-height:1.4;color:var(--label-ink, var(--ink));cursor:pointer}
.cf-customer-portal .cp-commit-t{text-wrap:pretty}
.cf-customer-portal .cp-cbox{position:absolute;left:0;top:0;width:26px;height:26px;margin:0;opacity:0;cursor:pointer;accent-color:var(--field-focus, var(--accent))}
.cf-customer-portal .cp-box{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:7px;background:var(--field, var(--card));border:2px solid var(--field-border, oklch(from var(--field-ink, var(--ink)) l c h / .5));transition:background-color .16s ease, border-color .16s ease}
.cf-customer-portal .cp-box svg{width:18px;height:18px;color:var(--accent-fill-ink, var(--card));opacity:0;transform:scale(.6);transition:opacity .16s ease, transform .16s ease}
.cf-customer-portal .cp-cbox:checked + .cp-box{background:var(--accent-fill, var(--accent));border-color:var(--accent-fill, var(--accent));color:var(--accent-fill-ink, var(--card))}
.cf-customer-portal .cp-cbox:checked + .cp-box svg{opacity:1;transform:none}
.cf-customer-portal .cp-cbox:focus-visible + .cp-box{outline:3px solid var(--cp-ring);outline-offset:2px}
.cf-customer-portal .cp-commit.is-error .cp-box{border-color:var(--danger)}
.cf-customer-portal .cp-err{margin:-4px 0 16px;padding:8px 12px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-customer-portal .cp-cta{display:flex;align-items:center;justify-content:center;width:100%;min-height:72px;margin:0;padding:12px 28px;border:0;border-radius:var(--button-radius, var(--radius, 12px));background:linear-gradient(oklch(from var(--cp-btn) calc(l + .04) c h), oklch(from var(--cp-btn-2) 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);font-size:clamp(1.125rem, 1.55vw, 1.375rem);line-height:1.15;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(--cp-btn) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--cp-btn) calc(l - .16) c h), 0 1px 2px oklch(from var(--cp-shadow) l c h / .3), 0 8px 16px -6px oklch(from var(--cp-shadow) l c h / .45));transition:transform .16s ease, box-shadow .16s ease, background .16s ease}
.cf-customer-portal .cp-cta:hover,.cf-customer-portal .cp-cta.is-hover{background:linear-gradient(oklch(from var(--cp-btn) calc(l - .01) c h), oklch(from var(--cp-btn-2) calc(l - .07) c h));transform:translateY(-1px)}
.cf-customer-portal .cp-cta:active,.cf-customer-portal .cp-cta.is-active{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--cp-btn) calc(l - .22) c h / .55), inset 0 -2px 0 oklch(from var(--cp-btn) calc(l - .16) c h), 0 1px 1px oklch(from var(--cp-shadow) l c h / .3)}
.cf-customer-portal .cp-cta:focus-visible{outline:3px solid var(--cp-ring);outline-offset:3px}
.cf-customer-portal .cp-cta:disabled{background:var(--secondary);color:color-mix(in oklch, var(--secondary-ink) 62%, var(--secondary));text-shadow:none;box-shadow:none;transform:none;cursor:not-allowed}
.cf-customer-portal .cp-anote{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-align:center;text-wrap:pretty}
.cf-customer-portal .cp-rv{animation:cp-rise .45s var(--cp-ease) both;animation-delay:calc(var(--i, 0) * .07s)}
@keyframes cp-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cp-spin{to{transform:rotate(360deg)}}
@media (min-width: 861px){.cf-customer-portal .cp-sec > .cp-list{margin-top:-14px}}
@media (max-width: 860px){
.cf-customer-portal .cp-sec{grid-template-columns:minmax(0,1fr);gap:16px}
.cf-customer-portal .cp-foot,.cf-customer-portal .cp-foot--solo{grid-template-columns:minmax(0,1fr)}
}
@media (max-width: 760px){
.cf-customer-portal .cp-head{grid-template-columns:minmax(0,1fr);gap:0}
.cf-customer-portal .cp-headtext{padding-bottom:8px}
.cf-customer-portal .cp-heroimg{justify-self:center;width:min(64vw, 260px);margin:0 auto 8px}
.cf-customer-portal.has-art .cp-acct{padding-right:0}
}
@media (max-width: 640px){
.cf-customer-portal .cp-orow{flex-wrap:wrap;column-gap:12px;row-gap:8px}
.cf-customer-portal .cp-date{display:none}
.cf-customer-portal .cp-mdate{display:inline}
.cf-customer-portal .cp-orow .cp-who{flex:1 1 100%}
.cf-customer-portal .cp-orow .cp-leader{display:none}
.cf-customer-portal .cp-orow .cp-chip{margin-left:auto}
.cf-customer-portal .cp-well{padding:14px 16px}
.cf-customer-portal .cp-drow{flex-wrap:wrap;row-gap:12px}
.cf-customer-portal .cp-drow .cp-who{flex:1 1 calc(100% - 80px)}
.cf-customer-portal .cp-drow .cp-leader{display:none}
.cf-customer-portal .cp-drow .cp-btn2{flex:1 1 100%}
.cf-customer-portal .cp-memtop{flex-wrap:wrap;row-gap:10px}
.cf-customer-portal .cp-memtop .cp-who{flex:1 1 100%}
.cf-customer-portal .cp-memtop .cp-leader{display:none}
.cf-customer-portal .cp-price{align-items:flex-start;text-align:left}
.cf-customer-portal .cp-sup{grid-template-columns:minmax(0,1fr);gap:16px}
.cf-customer-portal .cp-supimg{aspect-ratio:16/9}
.cf-customer-portal .cp-tnote{text-align:left}
}
@media (prefers-reduced-motion: reduce){
.cf-customer-portal .cp-rv,.cf-customer-portal .cp-spin{animation:none}
.cf-customer-portal .cp-orow,.cf-customer-portal .cp-chev,.cf-customer-portal .cp-link,.cf-customer-portal .cp-btn2,.cf-customer-portal .cp-box,.cf-customer-portal .cp-box svg,.cf-customer-portal .cp-cta{transition:none}
.cf-customer-portal .cp-cta:hover,.cf-customer-portal .cp-cta.is-hover{transform:none}
}
`;
pieces/checkout/customer-portal/specimen.tsx 77 lines
import __studioImage0491ea38 from "../assets/8118696138139bd1.webp";
import __studioImage4ae7b2d2 from "../assets/873ad1758106ea02.webp";
import { CustomerPortal, type CustomerPortalProps } from "../customer-portal";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
const sample = defaults.sample;
export const states = ["default", "hover", "active", "disabled", "error"];
export default function CustomerPortalSpecimen({ state = "default" }: { state?: CustomerPortalProps["state"] }) {
const items = sample.items;
return (
<CustomerPortal
state={state}
headline="Everything you own, ready when you are"
highlight="ready when you are"
lead="Download your kit, check every receipt and manage your membership from one page. No emails, no waiting."
productImage={slot(
"product",
__studioImage0491ea38
)}
productImageAlt={`${sample.name}: guide, workbook and checklist`}
customerName="Jordan Lee"
customerEmail="jordan.lee@example.com"
orders={[
{
id: "CF-10517",
date: "Nov 21, 2026",
title: "Funnel Review Membership, month 1",
status: "paid",
amount: "$19",
lines: [{ label: "Funnel Review Membership (monthly)", value: "$19" }],
payment: "Visa ending 4242",
},
{
id: "CF-10482",
date: "Nov 18, 2026",
title: sample.name,
status: "paid",
amount: sample.price,
lines: items.map((item) => ({ label: item.name, value: "Included" })),
payment: "Visa ending 4242",
},
]}
defaultOpenOrder="CF-10482"
downloads={items.map((item, i) => ({
name: item.name,
detail: item.detail,
format: "PDF",
image: slot(`item-${i + 1}`, item.image),
imageAlt: item.imageAlt,
}))}
membership={{
name: "Funnel Review Membership",
status: "active",
renews: "Dec 21, 2026",
price: "$19/month",
perDay: "About 63¢ a day",
}}
support={{
email: "support@example.com",
note: "Reply to any order email or write to us here. We answer within one business day.",
image: slot(
"scene",
__studioImage4ae7b2d2
),
imageAlt: "A tidy help desk with a laptop and headset",
}}
total="$66"
totalNote="2 orders · Visa ending 4242"
commitLabel={`I understand I'm covered by the ${sample.guarantee}`}
actionLabel="Download My Complete Kit"
actionNote="One ZIP · Guide, workbook and checklist"
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCustomerPortal |
string |
|
highlight OptionalCustomerPortal |
string |
|
lead OptionalCustomerPortal |
string |
|
productImage OptionalCustomerPortal |
string |
|
productImageAlt OptionalCustomerPortal |
string |
|
customerName OptionalCustomerPortal |
string |
|
customerEmail OptionalCustomerPortal |
string |
|
orders OptionalCustomerPortal |
PortalOrder[] |
|
defaultOpenOrder OptionalCustomerPortal |
string |
|
downloads OptionalCustomerPortal |
PortalDownload[] |
|
membership OptionalCustomerPortal |
PortalMembership |
|
support OptionalCustomerPortal |
PortalSupport |
|
total OptionalCustomerPortal |
string |
|
totalNote OptionalCustomerPortal |
string |
|
commitLabel OptionalCustomerPortal |
string |
|
actionLabel OptionalCustomerPortal |
string |
|
actionNote OptionalCustomerPortal |
string |
|
href OptionalCustomerPortal |
string |
|
onAction OptionalCustomerPortal |
() => void |
|
onDownload OptionalCustomerPortal |
(item: PortalDownload, index: number) => void |
|
onReceipt OptionalCustomerPortal |
(order: PortalOrder) => void |
|
onManage OptionalCustomerPortal |
(membership: PortalMembership) => void |
|
onSupport OptionalCustomerPortal |
(support: PortalSupport) => void |
|
actionDisabled OptionalCustomerPortal |
boolean |
|
copy OptionalCustomerPortal |
CustomerPortalCopyInput |
|
state OptionalCustomerPortal |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalCustomerPortal |
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- 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-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
product- The main product shot or cover (ebook, kit, bottle).
scene- A wide atmosphere photo behind or beside the copy.
-
8118696138139bd1.webp
image/webp · 168 KB
-
873ad1758106ea02.webp
image/webp · 67.8 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB