Order Help 1
Tells buyers how to get help with their order and takes them straight back to what they bought.
Use it in a prompt
Use checkout/order-help 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/order-help.tsx. - Import it and pass your copy and images (Props tab):
import { OrderHelp } from "@/components/funneldna/checkout/order-help"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/order-help/component.tsx 358 lines
// Tells buyers how to get help with their order and takes them straight back to what they bought.
// layout: letter-margin-notes
// Order help note for confirmation pages: a calm support letter (email, hours, what to send) beside a
// margin column that gets buyers straight back into their kit, so questions resolve fast and trust holds.
import * as React from "react"
import { AlertCircle, AtSign, Check, Clock, Copy, Hash, KeyRound, LifeBuoy, Mail, MessageSquare } from "lucide-react"
export type OrderHelpItem = {
name: string
/** Product photo; fill from theme slots item-1 … item-n. */
image?: string
imageAlt?: string
}
/** One thing the buyer should put in their support email. */
export type OrderHelpDetail = { title: string; detail?: string }
export type OrderHelpCopy = {
copyLabel: string
copiedLabel: string
retryLabel: string
/** Announced to screen readers after a successful copy. */
copiedStatus: string
/** Shown when the browser blocks copying (the address is selected instead). */
errorHint: string
}
export type OrderHelpProps = {
headline?: string
/** "{product}" is replaced by productName, set in bold. */
lead?: string
productName?: string
email?: string
/** Subject line pre-filled in the visitor's mail app. */
emailSubject?: string
hoursLabel?: string
/** Leave empty to hide the hours line. */
hours?: string
includeTitle?: string
include?: OrderHelpDetail[]
/** Margin note; "{highlight}" is replaced by noteHighlight under one marker stroke. Empty hides the note. */
note?: string
noteHighlight?: string
accessTitle?: string
accessText?: string
accessLabel?: string
accessHref?: string
onAccess?: (event: React.MouseEvent<HTMLAnchorElement>) => void
/** Called when the visitor presses Copy. */
onCopy?: (email: string) => void
items?: OrderHelpItem[]
copy?: Partial<OrderHelpCopy>
state?: "default" | "hover" | "active" | "success" | "error"
className?: string
}
const DEFAULT_COPY: OrderHelpCopy = {
copyLabel: "Copy",
copiedLabel: "Copied",
retryLabel: "Try again",
copiedStatus: "Email address copied.",
errorHint: "Copying is blocked here, so we selected the address. Press Ctrl+C or ⌘C.",
}
const DEFAULT_INCLUDE: OrderHelpDetail[] = [
{ title: "Your order number", detail: "It's on your receipt." },
{ title: "The email you checked out with", detail: "So we can find your account." },
{ title: "What you need help with", detail: "A line or two is plenty." },
]
const INCLUDE_ICONS = [Hash, AtSign, MessageSquare]
type CopyStatus = "idle" | "copied" | "error"
export function OrderHelp(props: OrderHelpProps) {
const {
headline = "Questions about your order?",
lead = "We're here to help with {product}. One email is all it takes.",
productName = "The Funnel Starter Kit",
email = "support@example.com",
emailSubject = "Help with my order #",
hoursLabel = "Response hours",
hours = "Monday–Friday, 9am–5pm ET",
includeTitle = "Put this in your email",
include = DEFAULT_INCLUDE,
note = "Add your {highlight} to the subject line so we can pull up your order.",
noteHighlight = "order number",
accessTitle = "Looking for your kit?",
accessText = "Your guide, workbook, and checklist are one click away.",
accessLabel = "Log in to access your kit",
accessHref = "#login",
onAccess,
onCopy,
items = [],
copy,
state = "default",
className,
} = props
const text = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const headingId = `${uid}-heading`
const emailId = `${uid}-email`
const emailRef = React.useRef<HTMLSpanElement>(null)
const timer = React.useRef<number | undefined>(undefined)
const [copyStatus, setCopyStatus] = React.useState<CopyStatus>("idle")
React.useEffect(() => () => window.clearTimeout(timer.current), [])
const status: CopyStatus = state === "success" ? "copied" : state === "error" ? "error" : copyStatus
const forced = state === "hover" ? " is-hover" : state === "active" ? " is-active" : ""
const mailto = `mailto:${email}${emailSubject ? `?subject=${encodeURIComponent(emailSubject)}` : ""}`
const shots = items.filter((item) => item.image).slice(0, 3)
const settle = (next: CopyStatus, ms: number) => {
setCopyStatus(next)
window.clearTimeout(timer.current)
timer.current = window.setTimeout(() => setCopyStatus("idle"), ms)
}
const handleCopy = async () => {
onCopy?.(email)
try {
if (!navigator.clipboard?.writeText) throw new Error("Clipboard unavailable")
await navigator.clipboard.writeText(email)
settle("copied", 2400)
} catch {
const node = emailRef.current
const selection = window.getSelection()
if (node && selection) {
const range = document.createRange()
range.selectNodeContents(node)
selection.removeAllRanges()
selection.addRange(range)
}
settle("error", 6000)
}
}
const StatusIcon = status === "copied" ? Check : status === "error" ? AlertCircle : Copy
const copyText = status === "copied" ? text.copiedLabel : status === "error" ? text.retryLabel : text.copyLabel
const statusText = status === "copied" ? text.copiedStatus : status === "error" ? text.errorHint : ""
return (
<section className={`cf-order-help${className ? ` ${className}` : ""}`} aria-labelledby={headingId}>
<style>{styles}</style>
<div className="cf-order-help__letter">
<div className="cf-order-help__top">
<LifeBuoy className="cf-order-help__badge" aria-hidden="true" />
<div className="cf-order-help__intro">
<h2 id={headingId} className="cf-order-help__headline">
{headline}
</h2>
<p className="cf-order-help__lead">{fill(lead, "{product}", <strong>{productName}</strong>)}</p>
<div className="cf-order-help__email">
<span className="cf-order-help__address-line">
<Mail className="cf-order-help__mail" aria-hidden="true" />
<a className="cf-order-help__address" href={mailto}>
<span id={emailId} ref={emailRef}>
{email}
</span>
</a>
</span>
<button
type="button"
className={`cf-order-help__copy${forced}`}
data-status={status}
onClick={handleCopy}
aria-describedby={emailId}
>
<StatusIcon key={status} aria-hidden="true" />
<span>{copyText}</span>
</button>
</div>
<p role="status" className={`cf-order-help__status${status === "error" ? "" : " cf-order-help__sr"}`}>
{statusText}
</p>
{hours ? (
<p className="cf-order-help__hours">
<Clock aria-hidden="true" />
<span>
<strong>{hoursLabel}:</strong> {hours}
</span>
</p>
) : null}
</div>
</div>
<div className="cf-order-help__include">
<h3>{includeTitle}</h3>
<ul>
{include.map((entry, index) => {
const Icon = INCLUDE_ICONS[index % INCLUDE_ICONS.length]
return (
<li key={`${entry.title}-${index}`}>
<Icon aria-hidden="true" />
<span>
<strong>{entry.title}</strong>
{entry.detail ? <span className="cf-order-help__detail"> {entry.detail}</span> : null}
</span>
</li>
)
})}
</ul>
</div>
</div>
<div className="cf-order-help__margin">
<div className={`cf-order-help__access${forced}`}>
{shots.length ? (
<div className="cf-order-help__thumbs">
{shots.map((item, index) => (
<img
key={`${item.name}-${index}`}
src={item.image}
alt={item.imageAlt ?? item.name}
width={68}
height={68}
loading="lazy"
decoding="async"
/>
))}
</div>
) : null}
<h3>{accessTitle}</h3>
{accessText ? <p>{accessText}</p> : null}
<a className={`cf-order-help__login${forced}`} href={accessHref} onClick={onAccess}>
<KeyRound aria-hidden="true" />
<span>{accessLabel}</span>
</a>
</div>
{note ? (
<div className="cf-order-help__note">
<p className="cf-order-help__note-text">
{fill(note, "{highlight}", <span className="cf-order-help__marker">{noteHighlight}</span>)}
</p>
</div>
) : null}
</div>
</section>
)
}
export default OrderHelp
function fill(template: string, token: string, node: React.ReactNode): React.ReactNode {
const at = template.indexOf(token)
if (at < 0) return template
return (
<>
{template.slice(0, at)}
{node}
{template.slice(at + token.length)}
</>
)
}
const styles = `
.cf-order-help{
--oh-pad:clamp(1.25rem,0.8rem + 1.8vw,2.25rem);
--oh-gap:clamp(1.5rem,1rem + 2vw,2.75rem);
--oh-well:color-mix(in oklch,var(--ink) 4%,var(--card));
--oh-margin:color-mix(in oklch,var(--ink) 5%,var(--surface));
--oh-focus:var(--field-focus,var(--accent));
--oh-shadow:var(--shadow,oklch(0.22 0.03 256));
box-sizing:border-box;width:100%;max-width:64rem;margin-inline:auto;
display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);grid-template-rows:auto auto;column-gap:var(--oh-gap);
font-family:var(--font-body);color:var(--ink);font-size:1rem;line-height:1.5;
}
.cf-order-help *,.cf-order-help *::before,.cf-order-help *::after{box-sizing:border-box}
.cf-order-help :where(h2,h3,p,ul){margin:0;padding:0}
.cf-order-help :where(h2,h3){text-wrap:balance}
.cf-order-help :where(p,li){text-wrap:pretty}
.cf-order-help svg{flex:none}
.cf-order-help a:focus-visible,.cf-order-help button:focus-visible{outline:3px solid var(--oh-focus);outline-offset:3px}
.cf-order-help__letter{grid-column:1;grid-row:1 / span 2;display:grid;grid-template-rows:subgrid;min-width:0;overflow:clip;background:var(--card);color:var(--ink);border:1px solid var(--card-border,color-mix(in oklch,var(--ink) 12%,transparent));border-radius:var(--card-radius,var(--radius));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(0.22 0.03 256 / 0.22),0 4px 10px -2px oklch(0.22 0.03 256 / 0.2)))}
.cf-order-help__top{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:1rem;align-items:start;padding:var(--oh-pad) var(--oh-pad) calc(var(--oh-pad) * 0.85)}
.cf-order-help__badge{width:2.75rem;height:2.75rem;margin-top:.1rem;color:var(--accent);stroke-width:1.75}
.cf-order-help__intro{min-width:0}
.cf-order-help__headline{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.02em);font-size:clamp(1.625rem,1.1rem + 1.7vw,2.375rem);line-height:1.08;color:var(--ink)}
.cf-order-help__lead{margin-top:.7rem;font-size:clamp(1.0625rem,1rem + .3vw,1.1875rem);font-weight:500;line-height:1.5;color:var(--muted)}
.cf-order-help__lead strong{font-weight:700;color:var(--ink)}
.cf-order-help__email{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin-top:1.375rem}
.cf-order-help__address-line{display:inline-flex;align-items:center;gap:.625rem;min-width:0}
.cf-order-help__mail{width:1.5rem;height:1.5rem;color:var(--accent)}
.cf-order-help__address{display:inline-block;padding-block:.35rem;min-width:0;border-radius:.25rem;font-family:var(--font-display);font-weight:800;font-size:clamp(1.25rem,1.05rem + .8vw,1.625rem);line-height:1.2;color:var(--link,var(--accent));text-decoration:underline;text-decoration-thickness:2px;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / 0.45);text-underline-offset:.18em;overflow-wrap:anywhere}
.cf-order-help__address:hover{color:oklch(from var(--link,var(--accent)) calc(l - 0.08) c h);text-decoration-color:currentColor}
.cf-order-help__copy{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.75rem;padding:0 1.05rem;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius));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;cursor:pointer}
.cf-order-help__copy svg{width:1.05rem;height:1.05rem}
.cf-order-help__copy:hover,.cf-order-help__copy.is-hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.04) c h);transform:translateY(-1px)}
.cf-order-help__copy:active,.cf-order-help__copy.is-active{transform:translateY(1px);box-shadow:var(--button-2-shadow, var(--shadow-sm))}
.cf-order-help__copy[data-status="copied"]{background:var(--success-soft);color:var(--success);box-shadow:inset 0 0 0 1px oklch(from var(--success) l c h / 0.35);transform:none}
.cf-order-help__copy[data-status="error"]{background:var(--danger-soft);color:var(--danger);box-shadow:inset 0 0 0 1px oklch(from var(--danger) l c h / 0.35);transform:none}
.cf-order-help__status{margin-top:.625rem;font-size:.9375rem;font-weight:600;line-height:1.45;color:var(--danger)}
.cf-order-help__sr{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cf-order-help__hours{display:flex;align-items:flex-start;gap:.5rem;margin-top:1rem;font-size:1rem;color:var(--muted)}
.cf-order-help__hours svg{width:1.125rem;height:1.125rem;margin-top:.17rem;color:var(--muted)}
.cf-order-help__hours strong{font-weight:700;color:var(--ink)}
.cf-order-help__include{background:var(--oh-well);color:var(--ink);padding:calc(var(--oh-pad) * 0.8) var(--oh-pad) var(--oh-pad)}
.cf-order-help__include h3{font-family:var(--font-display);font-weight:800;font-size:1.0625rem;line-height:1.3;color:var(--ink)}
.cf-order-help__include ul{list-style:none;display:grid;gap:.7rem;margin-top:.875rem}
.cf-order-help__include li{display:grid;grid-template-columns:1.25rem minmax(0,1fr);gap:.75rem;align-items:start;font-size:1rem;line-height:1.45}
.cf-order-help__include li svg{width:1.125rem;height:1.125rem;margin-top:.15rem;color:var(--accent)}
.cf-order-help__include li strong{font-weight:700;color:var(--ink)}
.cf-order-help__detail{color:var(--muted)}
.cf-order-help__margin{grid-column:2;grid-row:1 / span 2;display:grid;grid-template-rows:subgrid;min-width:0;background:var(--oh-margin);color:var(--ink);border-radius:var(--card-radius,var(--radius))}
.cf-order-help__access{display:flex;flex-direction:column;align-items:flex-start;min-width:0;padding:var(--oh-pad) calc(var(--oh-pad) * 0.85) calc(var(--oh-pad) * 0.7)}
.cf-order-help__thumbs{display:flex;align-items:flex-end;margin-bottom:1.25rem;padding-left:.35rem}
.cf-order-help__thumbs img{display:block;width:4.25rem;height:4.25rem;object-fit:cover;object-position:center;border-radius:.625rem;filter:drop-shadow(0 1px 1px oklch(from var(--oh-shadow) l c h / 0.3)) drop-shadow(0 4px 6px oklch(from var(--oh-shadow) l c h / 0.2))}
.cf-order-help__thumbs img + img{margin-left:-1.1rem}
.cf-order-help__thumbs img:nth-child(1){transform:rotate(-7deg)}
.cf-order-help__thumbs img:nth-child(2){position:relative;z-index:1;transform:translateY(-.3rem)}
.cf-order-help__thumbs img:nth-child(3){transform:rotate(6deg)}
.cf-order-help__access:hover .cf-order-help__thumbs img:nth-child(1),.cf-order-help__access.is-hover .cf-order-help__thumbs img:nth-child(1){transform:rotate(-10deg) translateX(-.35rem)}
.cf-order-help__access:hover .cf-order-help__thumbs img:nth-child(2),.cf-order-help__access.is-hover .cf-order-help__thumbs img:nth-child(2){transform:translateY(-.6rem)}
.cf-order-help__access:hover .cf-order-help__thumbs img:nth-child(3),.cf-order-help__access.is-hover .cf-order-help__thumbs img:nth-child(3){transform:rotate(9deg) translateX(.35rem)}
.cf-order-help__access h3{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.01em);font-size:clamp(1.25rem,1.1rem + .5vw,1.5rem);line-height:1.15;color:var(--ink)}
.cf-order-help__access p{margin-top:.5rem;font-size:1rem;line-height:1.5;color:var(--muted)}
.cf-order-help__login{display:inline-flex;align-items:center;justify-content:center;gap:.55rem;width:100%;min-height:3.25rem;margin-top:1.25rem;padding:.75rem 1.25rem;border-radius:var(--button-radius,var(--radius));background:linear-gradient(var(--button-bg,var(--cta)),var(--button-bg-2,var(--cta-2)));color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.12) c h / 0.6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--oh-shadow) l c h / 0.3),0 4px 10px -3px oklch(from var(--oh-shadow) l c h / 0.35));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:1.0625rem;line-height:1.2;text-align:center;text-wrap:balance;text-decoration:none}
.cf-order-help__login svg{width:1.125rem;height:1.125rem}
.cf-order-help__login:hover,.cf-order-help__login.is-hover{background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.05) c h));transform:translateY(-1px)}
.cf-order-help__login:active,.cf-order-help__login.is-active{transform:translateY(1px);box-shadow:inset 0 -1px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--oh-shadow) l c h / 0.3)}
.cf-order-help__note{align-self:center;padding:1rem calc(var(--oh-pad) * 0.85) 1.25rem}
.cf-order-help__note-text{font-family:var(--font-display);font-weight:700;font-size:1.125rem;line-height:1.5;color:var(--ink)}
.cf-order-help__marker{color:var(--field-ink);background:color-mix(in oklch,var(--marker,#fae37c) 82%,var(--field));padding:.06em .3em .1em;margin-inline:-.05em;border-radius:.3em .5em .35em .45em / .5em .35em .5em .4em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
@media (prefers-reduced-motion:no-preference){
.cf-order-help__copy,.cf-order-help__login{transition:background-color .18s ease,color .18s ease,transform .14s ease,box-shadow .18s ease}
.cf-order-help__address{transition:color .18s ease,text-decoration-color .18s ease}
.cf-order-help__thumbs img{transition:transform .32s cubic-bezier(.2,.7,.2,1)}
.cf-order-help__copy svg{animation:cf-order-help-pop .28s cubic-bezier(.2,.7,.2,1) both}
.cf-order-help__note{animation:cf-order-help-in .5s .15s cubic-bezier(.2,.7,.2,1) both}
@keyframes cf-order-help-pop{from{opacity:.4;transform:scale(.6)}to{opacity:1;transform:scale(1)}}
@keyframes cf-order-help-in{from{opacity:.82;translate:0 8px}to{opacity:1;translate:0 0}}
}
@media (max-width:47.99rem){
.cf-order-help{grid-template-columns:minmax(0,1fr);grid-template-rows:none;row-gap:1rem}
.cf-order-help__letter,.cf-order-help__margin{grid-column:1;grid-row:auto;grid-template-rows:none}
.cf-order-help__letter{display:block}
.cf-order-help__margin{display:flex;flex-direction:column}
.cf-order-help__top{grid-template-columns:minmax(0,1fr)}
.cf-order-help__badge{width:2.25rem;height:2.25rem;margin:0 0 .75rem}
.cf-order-help__access{padding:1.25rem 1.25rem 1.5rem}
.cf-order-help__note{order:-1;padding:1rem 1.25rem 0}
.cf-order-help__note-text{font-size:1.0625rem}
}
@media (forced-colors:active){
.cf-order-help__letter,.cf-order-help__margin{border:1px solid CanvasText}
.cf-order-help__copy,.cf-order-help__login{border:1px solid ButtonText}
}
`
pieces/checkout/order-help/specimen.tsx 21 lines
import * as React from "react"
import { OrderHelp, type OrderHelpProps } from "../order-help"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "success", "error"]
export default function OrderHelpSpecimen({ state = "default" }: { state?: OrderHelpProps["state"] }) {
const sample = defaults.sample
return (
<OrderHelp
state={state}
productName={sample.name}
items={sample.items.map((item, index) => ({
name: item.name,
image: slot(`item-${index + 1}`, item.image),
imageAlt: item.imageAlt,
}))}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalOrderHelp |
string |
|
lead OptionalOrderHelp |
string |
|
productName OptionalOrderHelp |
string |
|
email OptionalOrderHelp |
string |
|
emailSubject OptionalOrderHelp |
string |
|
hoursLabel OptionalOrderHelp |
string |
|
hours OptionalOrderHelp |
string |
|
includeTitle OptionalOrderHelp |
string |
|
include OptionalOrderHelp |
OrderHelpDetail[] |
|
note OptionalOrderHelp |
string |
|
noteHighlight OptionalOrderHelp |
string |
|
accessTitle OptionalOrderHelp |
string |
|
accessText OptionalOrderHelp |
string |
|
accessLabel OptionalOrderHelp |
string |
|
accessHref OptionalOrderHelp |
string |
|
onAccess OptionalOrderHelp |
(event: React.MouseEvent<HTMLAnchorElement>) => void |
|
onCopy OptionalOrderHelp |
(email: string) => void |
|
items OptionalOrderHelp |
OrderHelpItem[] |
|
copy OptionalOrderHelp |
Partial<OrderHelpCopy> |
|
state OptionalOrderHelp |
"default" | "hover" | "active" | "success" | "error" |
|
className OptionalOrderHelp |
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-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.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB