Order Bump 2
Order bump block: the add-on waits as a dashed pending line under a mini receipt. One tick lifts it into the receipt and rolls the total, and the path ends at the button.
Use it in a prompt
Use offer/order-bump-2 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/offer/order-bump-2.tsx. - Import it and pass your copy and images (Props tab):
import { OrderBump2 } from "@/components/funneldna/offer/order-bump-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/order-bump-2/component.tsx 564 lines
// layout: path-to-action
// Order bump block: the add-on waits as a dashed pending line under a mini receipt. One tick lifts it into the receipt and rolls the total, and the path ends at the button.
"use client"
import * as React from "react"
import { Ban, Check, Lock } from "lucide-react"
import { FX_HOST, Texture } from "../fx/fx"
import concrete from "../fx/textures/concrete"
export type OrderBump2Item = {
name: string
/** Short line under the name, e.g. "Hand-poured cast iron". */
detail?: string
/** Price as a number in the order currency, e.g. 89. */
price: number
/** Transparent product cut-out (slot "product"); it rests on top of the receipt. */
image?: string
imageAlt?: string
}
export type OrderBump2Detail = {
checked: boolean
/** The resulting total as a number. */
total: number
/** The resulting total formatted in the order currency. */
totalText: string
}
/** Text templates may use {price} (add-on price), {total} (live total) and {name} (add-on name); each is replaced as text. */
export type OrderBump2Props = {
/** "active" = ticked. */
state?: "default" | "hover" | "active" | "disabled"
headline?: string
/** Phrase inside the headline that carries the marker stroke. */
headlineMark?: string
/** One-sentence paragraphs under the headline. */
lines?: string[]
/** Single-word closing line set large, e.g. "Done." */
punch?: string
/** The item already in the order. */
item?: OrderBump2Item
/** Add-on name as it reads once it joins the receipt. */
bumpName?: string
/** First-person yes line beside the checkbox. */
bumpYes?: string
/** One sentence on what the add-on does for the buyer. */
bumpSentence?: string
/** Add-on price as a number in the order currency. */
bumpPrice?: number
/** Price line on the pending line; {price} is replaced. */
bumpPriceLabel?: string
/** The price said in words, e.g. "less than one takeout lunch". Only pass a true comparison. */
bumpPriceWords?: string
/** Transparent cut-out of the add-on (slot "item-1"). Hidden on phones. */
bumpImage?: string
bumpImageAlt?: string
/** Note under the add-on once it sits in the receipt. */
addedNote?: string
totalLabel?: string
/** Under the total while unticked. {name} and {price} are replaced. */
totalNote?: string
/** Under the total once ticked. {name} and {price} are replaced. */
totalNoteAdded?: string
/** The question the button answers. */
question?: string
actionLabel?: string
/** Line under the button; {total} is replaced. */
reassurance?: string
/** Shown on the line when the add-on can't be chosen. */
disabledNote?: string
/** ISO currency code, e.g. "USD". */
currency?: string
locale?: string
href?: string
onAction?: (detail: OrderBump2Detail) => void
checked?: boolean
defaultChecked?: boolean
/** Reports the new checked state and the resulting total. */
onChange?: (checked: boolean, detail: OrderBump2Detail) => void
disabled?: boolean
id?: string
className?: string
}
export function OrderBump2({
state = "default",
headline = "Cook on it the day it arrives",
headlineMark = "the day it arrives",
lines = DEFAULT_LINES,
punch = "Done.",
item = DEFAULT_ITEM,
bumpName = "Ember Peak Seasoning Oil",
bumpYes = "Yes, add the seasoning oil",
bumpSentence = "One bottle builds the slick, rust-proof coat your skillet needs before the first sear.",
bumpPrice = 14,
bumpPriceLabel = "Just {price}",
bumpPriceWords,
bumpImage,
bumpImageAlt = "",
addedNote = "Added · untick to remove",
totalLabel = "Total today",
totalNote = "Tick the line below to add {name}",
totalNoteAdded = "Includes {name}",
question = "Ready to cook on it this weekend?",
actionLabel = "I'm ready, send my skillet",
reassurance = "{total} today · Secure checkout",
disabledNote = "This add-on isn't available on this order.",
currency = "USD",
locale = "en-US",
href,
onAction,
checked,
defaultChecked,
onChange,
disabled = false,
id,
className,
}: OrderBump2Props) {
const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, "")
const baseId = id ?? `ob2-${uid}`
const inputId = `${baseId}-input`
const nameId = `${baseId}-name`
const descId = `${baseId}-desc`
const priceId = `${baseId}-price`
const [inner, setInner] = React.useState<boolean>(defaultChecked ?? state === "active")
React.useEffect(() => {
if (checked === undefined && defaultChecked === undefined) setInner(state === "active")
}, [state, checked, defaultChecked])
const isChecked = checked ?? inner
const isDisabled = disabled || state === "disabled"
const frac = [item.price, bumpPrice].every((n) => Number.isInteger(n)) ? 0 : 2
const money = makeMoney(locale, currency, frac)
const totalFor = (on: boolean) => Math.round((item.price + (on ? bumpPrice : 0)) * 100) / 100
const totalValue = totalFor(isChecked)
const totalText = money(totalValue)
const priceText = money(bumpPrice)
const vars = { price: priceText, total: totalText, name: bumpName }
const detail: OrderBump2Detail = { checked: isChecked, total: totalValue, totalText }
const ledgerRef = React.useRef<HTMLDivElement>(null)
const snap = React.useRef<Map<string, DOMRect> | null>(null)
const running = React.useRef<Animation[]>([])
const measure = () => {
const map = new Map<string, DOMRect>()
ledgerRef.current?.querySelectorAll<HTMLElement>("[data-flip]").forEach((el) => {
map.set(el.dataset.flip ?? "", el.getBoundingClientRect())
})
return map
}
// The signature: the line travels between the pending slot and the receipt, and the receipt grows or shrinks to meet it.
useIsoLayoutEffect(() => {
const before = snap.current
snap.current = null
const root = ledgerRef.current
if (!before || !root || prefersReduced()) return
running.current.forEach((a) => a.cancel())
running.current = []
const opts: KeyframeAnimationOptions = { duration: 460, easing: "cubic-bezier(.2,.7,.2,1)" }
root.querySelectorAll<HTMLElement>("[data-flip]").forEach((el) => {
if (typeof el.animate !== "function") return
const key = el.dataset.flip ?? ""
const a = before.get(key)
if (!a) return
const b = el.getBoundingClientRect()
if (key === "paper") {
if (Math.abs(a.height - b.height) > 0.5) {
running.current.push(el.animate([{ height: `${a.height}px` }, { height: `${b.height}px` }], opts))
}
return
}
const dy = a.top - b.top
if (Math.abs(dy) > 0.5) {
running.current.push(el.animate([{ transform: `translateY(${dy}px)` }, { transform: "translateY(0)" }], opts))
}
})
}, [isChecked])
const handle = (e: React.ChangeEvent<HTMLInputElement>) => {
if (isDisabled) return
const next = e.target.checked
snap.current = measure()
if (typeof window !== "undefined") window.requestAnimationFrame(() => { snap.current = null })
if (checked === undefined) setInner(next)
const t = totalFor(next)
onChange?.(next, { checked: next, total: t, totalText: money(t) })
}
return (
<section
className={["cf-order-bump-2", className].filter(Boolean).join(" ")}
style={FX_HOST}
aria-labelledby={`${baseId}-title`}
data-checked={isChecked ? "" : undefined}
data-disabled={isDisabled ? "" : undefined}
data-hover={state === "hover" ? "" : undefined}
data-noimg={item.image ? undefined : ""}
>
<style>{CSS}</style>
<Texture src={concrete} tone="ink" />
<div className="ob2-wrap">
<header className="ob2-head ob2-in">
<h2 id={`${baseId}-title`} className="ob2-title">
{marked(headline, headlineMark)}
</h2>
{lines.length > 0 ? (
<div className="ob2-lines">
{lines.map((line, i) => (
<p key={i}>{line}</p>
))}
</div>
) : null}
{punch ? <p className="ob2-punch">{punch}</p> : null}
</header>
<div className="ob2-ledger ob2-in" ref={ledgerRef} style={{ ["--d" as string]: ".07s" } as React.CSSProperties}>
<div className="ob2-paper" data-flip="paper" aria-hidden="true" />
<div className="ob2-top ob2-stop" data-flip="top">
{item.image ? (
<figure className="ob2-figure">
<img src={item.image} alt={item.imageAlt ?? ""} width={480} height={480} loading="lazy" decoding="async" />
</figure>
) : null}
<div className="ob2-row">
<div className="ob2-row-text">
<h3 className="ob2-name">{item.name}</h3>
{item.detail ? <p className="ob2-detail">{item.detail}</p> : null}
</div>
<span className="ob2-amount">{money(item.price)}</span>
</div>
</div>
<div className="ob2-total ob2-stop" data-flip="total">
<div>
<p className="ob2-total-label">{totalLabel}</p>
<p className="ob2-total-note">{fill(isChecked ? totalNoteAdded : totalNote, vars)}</p>
</div>
<p className="ob2-total-num">
<Roll text={totalText} />
<span className="ob2-sr" aria-live="polite">{`${totalLabel}: ${totalText}`}</span>
</p>
</div>
<div className="ob2-bump ob2-stop" data-flip="bump" data-thumb={bumpImage ? "" : undefined}>
<label htmlFor={inputId} className="ob2-line">
<span className="ob2-tick">
<input
id={inputId}
className="ob2-input"
type="checkbox"
checked={isChecked}
disabled={isDisabled}
aria-labelledby={`${nameId} ${priceId}`}
aria-describedby={isChecked ? undefined : descId}
onChange={handle}
/>
<span className="ob2-box" aria-hidden="true">
<Check strokeWidth={3} />
</span>
</span>
{bumpImage ? (
<img className="ob2-thumb" src={bumpImage} alt={bumpImageAlt} width={112} height={112} loading="lazy" decoding="async" />
) : null}
<span key={isChecked ? "in" : "out"} className="ob2-text ob2-swap">
<span id={nameId} className="ob2-yes">{isChecked ? bumpName : bumpYes}</span>
{isChecked ? (
<span className="ob2-added">{addedNote}</span>
) : (
<span id={descId} className="ob2-sentence">{bumpSentence}</span>
)}
</span>
<span key={isChecked ? "pin" : "pout"} id={priceId} className="ob2-price ob2-swap">
{isChecked ? (
<span className="ob2-amount">{priceText}</span>
) : (
<>
<span className="ob2-just">{fill(bumpPriceLabel, vars)}</span>
{bumpPriceWords ? <span className="ob2-words">{bumpPriceWords}</span> : null}
</>
)}
</span>
</label>
{isDisabled && disabledNote ? (
<p className="ob2-dnote">
<Ban strokeWidth={2.5} aria-hidden="true" />
{disabledNote}
</p>
) : null}
</div>
<div className="ob2-cta ob2-stop" data-flip="cta">
{question ? <p className="ob2-question">{question}</p> : null}
{href ? (
<a className="ob2-btn" href={href} onClick={() => onAction?.(detail)}>
{actionLabel}
</a>
) : (
<button type="button" className="ob2-btn" onClick={() => onAction?.(detail)}>
{actionLabel}
</button>
)}
</div>
</div>
{reassurance ? (
<p className="ob2-reassure">
<Lock strokeWidth={2.5} aria-hidden="true" />
{fill(reassurance, vars)
.split(" · ")
.map((seg, i) => (
<React.Fragment key={i}>
{i > 0 ? " · " : null}
<span className="ob2-seg">{seg}</span>
</React.Fragment>
))}
</p>
) : null}
</div>
</section>
)
}
export default OrderBump2
const DEFAULT_LINES = [
"Bare cast iron wants a seasoning coat before the first sear.",
"Tick the line under your receipt and the oil ships in the same box.",
]
const DEFAULT_ITEM: OrderBump2Item = {
name: "Ember Peak 12-inch Skillet",
detail: "Hand-poured cast iron · Helper handle",
price: 89,
}
const DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
const useIsoLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect
function prefersReduced() {
return (
typeof window !== "undefined" &&
typeof window.matchMedia === "function" &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches
)
}
/** The total as rolling digit columns; the real value is always what each column shows at rest. */
function Roll({ text }: { text: string }) {
const chars = Array.from(text)
return (
<span className="ob2-roll" aria-hidden="true">
{chars.map((ch, i) => {
const k = chars.length - i
if (ch >= "0" && ch <= "9") {
return (
<span key={`d${k}`} className="ob2-digit">
<span className="ob2-col" style={{ ["--d" as string]: ch } as React.CSSProperties}>
{DIGITS.map((d) => (
<span key={d}>{d}</span>
))}
</span>
</span>
)
}
return (
<span key={`c${k}${ch}`} className="ob2-sym">
{ch}
</span>
)
})}
</span>
)
}
function makeMoney(locale: string, currency: string, frac: number) {
let f: Intl.NumberFormat | null = null
try {
f = new Intl.NumberFormat(locale, {
style: "currency",
currency,
minimumFractionDigits: frac,
maximumFractionDigits: frac,
})
} catch {
f = null
}
return (n: number) => (f ? f.format(n) : `${currency} ${n.toFixed(frac)}`)
}
function fill(text: string, vars: Record<string, string>) {
return text.replace(/\{(\w+)\}/g, (m, key: string) => (key in vars ? vars[key] : m))
}
function marked(text: string, mark?: string) {
const at = mark ? text.indexOf(mark) : -1
if (!mark || at < 0) return text
return (
<>
{text.slice(0, at)}
<span className="ob2-mark">{mark}</span>
{text.slice(at + mark.length)}
</>
)
}
const CSS = `
.cf-order-bump-2{
--ob2-img:clamp(168px,20vw,248px);
--ob2-lift:calc(var(--ob2-img) * .58);
--ob2-pad:clamp(20px,3vw,32px);
--ob2-btn-h:72px;
--ob2-ease:cubic-bezier(.2,.7,.2,1);
--ob2-radius:var(--card-radius,var(--radius,14px));
--ob2-shadow-c:var(--shadow,oklch(0.22 0.03 256));
--ob2-bump:var(--bump,oklch(0.975 0.04 95));
--ob2-strip:var(--bump-strip,oklch(0.93 0.11 95));
--ob2-bump-ink:var(--bump-ink,var(--ink,oklch(0.21 0.034 263)));
--ob2-stop:var(--accent-fill,var(--accent,oklch(0.5 0.17 257)));
box-sizing:border-box;
width:100%;
padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);
background:var(--surface,#fff);
color:var(--ink,#101828);
font-family:var(--font-body,Arial,sans-serif);
overflow-x:clip;
}
.cf-order-bump-2[data-noimg]{--ob2-img:0px;--ob2-lift:0px}
.cf-order-bump-2 *,.cf-order-bump-2 *::before,.cf-order-bump-2 *::after{box-sizing:border-box}
.cf-order-bump-2 .ob2-wrap{position:relative;z-index:1;max-width:46rem;margin:0 auto}
/* headline */
.cf-order-bump-2 .ob2-head{text-align:center}
.cf-order-bump-2 .ob2-title{margin:0 0 16px;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink,#101828)}
.cf-order-bump-2 .ob2-mark{color:var(--marker-ink,var(--bump-ink,var(--ink,#101828)));background:linear-gradient(to bottom,transparent 26%,var(--marker,var(--bump-strip,#fae37c)) 26%,var(--marker,var(--bump-strip,#fae37c)) 94%,transparent 94%);padding:0 .1em;border-radius:.3em .5em .45em .25em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-order-bump-2 .ob2-lines{display:grid;gap:4px;max-width:40rem;margin:0 auto}
.cf-order-bump-2 .ob2-lines p{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted,#4a5565);text-wrap:pretty}
.cf-order-bump-2 .ob2-punch{margin:12px 0 0;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;color:var(--ink,#101828)}
/* ledger: receipt paper + rows on one grid, so the bump line keeps its node while it moves */
.cf-order-bump-2 .ob2-ledger{position:relative;display:grid;grid-template-columns:minmax(0,1fr);margin-top:48px}
.cf-order-bump-2 .ob2-paper{grid-column:1;grid-row:1 / 3;position:relative;z-index:0;margin-top:var(--ob2-lift);background:var(--card,#fff);border:1px solid var(--card-border,oklch(from var(--ink,#101828) l c h / .12));border-radius:var(--ob2-radius);box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 256 / .22),0 12px 24px -8px oklch(0.22 0.03 256 / .32)))}
.cf-order-bump-2[data-checked] .ob2-paper{grid-row:1 / 4}
.cf-order-bump-2 .ob2-top,.cf-order-bump-2 .ob2-total,.cf-order-bump-2 .ob2-bump,.cf-order-bump-2 .ob2-cta{grid-column:1;position:relative;z-index:1;min-width:0}
/* the item on the receipt */
.cf-order-bump-2 .ob2-top{grid-row:1}
.cf-order-bump-2 .ob2-figure{margin:0;height:var(--ob2-img);display:flex;justify-content:center;align-items:flex-end}
.cf-order-bump-2 .ob2-figure img{display:block;height:100%;width:auto;max-width:100%;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--ob2-shadow-c) l c h / .32)) drop-shadow(0 14px 16px oklch(from var(--ob2-shadow-c) l c h / .22))}
.cf-order-bump-2 .ob2-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px var(--ob2-pad) 20px}
.cf-order-bump-2 .ob2-row-text{min-width:0}
.cf-order-bump-2 .ob2-name{margin:0;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.2;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-wrap:balance;color:var(--ink,#101828)}
.cf-order-bump-2 .ob2-detail{margin:6px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4a5565);text-wrap:pretty}
.cf-order-bump-2 .ob2-amount{flex:none;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.2;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
/* total well: no divider, a quiet grey well */
.cf-order-bump-2 .ob2-total{grid-row:2;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:0 12px 12px;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#fff));color:var(--ink,#101828)}
.cf-order-bump-2[data-checked] .ob2-total{grid-row:3}
.cf-order-bump-2 .ob2-total-label{margin:0;font-size:1.0625rem;line-height:1.3;font-weight:700}
.cf-order-bump-2 .ob2-total-note{margin:4px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4a5565);text-wrap:pretty}
.cf-order-bump-2 .ob2-total-num{margin:0 0 0 auto;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-weight:800;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-order-bump-2 .ob2-roll{display:inline-flex;align-items:flex-start;height:1.25em;line-height:1.25;overflow:hidden}
.cf-order-bump-2 .ob2-sym,.cf-order-bump-2 .ob2-digit{display:inline-block;height:1.25em;line-height:1.25}
.cf-order-bump-2 .ob2-digit{overflow:hidden}
.cf-order-bump-2 .ob2-col{display:flex;flex-direction:column;transform:translateY(calc(var(--d) * -10%));transition:transform .6s var(--ob2-ease) .12s}
.cf-order-bump-2 .ob2-col>span{display:block;height:1.25em;line-height:1.25;text-align:center}
.cf-order-bump-2 .ob2-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
/* the bump: a dashed pending line under the receipt, a receipt line once ticked */
.cf-order-bump-2 .ob2-bump{grid-row:3;margin-top:16px;border:2px dashed oklch(from var(--ob2-bump-ink) l c h / .55);border-radius:var(--ob2-radius);background:var(--ob2-bump);color:var(--ob2-bump-ink);box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 256 / .18),0 1px 3px oklch(0.22 0.03 256 / .14));transition:background-color .3s ease,border-color .3s ease,box-shadow .2s ease,color .3s ease}
.cf-order-bump-2[data-checked] .ob2-bump{grid-row:2;margin-top:0;border-color:transparent;border-radius:0;background:var(--card,#fff);color:var(--ink,#101828);box-shadow:inset 0 1px 0 oklch(from var(--ink,#101828) l c h / .1)}
.cf-order-bump-2 .ob2-line{display:grid;grid-template-columns:64px minmax(0,1fr) auto;grid-template-areas:'tick text price';align-items:center;column-gap:16px;min-height:96px;padding-right:var(--ob2-pad);cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-order-bump-2 .ob2-bump[data-thumb] .ob2-line{grid-template-columns:64px 72px minmax(0,1fr) auto;grid-template-areas:'tick thumb text price'}
.cf-order-bump-2[data-checked] .ob2-line{min-height:76px}
.cf-order-bump-2 .ob2-tick{grid-area:tick;align-self:stretch;position:relative;display:grid;place-items:center;min-height:56px;background:var(--ob2-strip);border-radius:calc(var(--ob2-radius) - 2px) 0 0 calc(var(--ob2-radius) - 2px);transition:background-color .3s ease}
.cf-order-bump-2[data-checked] .ob2-tick{background:transparent}
.cf-order-bump-2 .ob2-input{position:absolute;inset:0;z-index:2;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.cf-order-bump-2 .ob2-box{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;border:2px solid var(--ob2-bump-ink);background:var(--field,var(--card,#fff));color:transparent;box-shadow:inset 0 2px 3px oklch(from var(--ob2-shadow-c) l c h / .18);transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.cf-order-bump-2 .ob2-box svg{width:20px;height:20px;opacity:0;transform:scale(.6);transition:transform .2s var(--ob2-ease),opacity .15s ease}
.cf-order-bump-2 .ob2-input:checked + .ob2-box{background:var(--success,oklch(0.5 0.14 150));border-color:var(--success,oklch(0.5 0.14 150));color:var(--ob2-on-status,#fff);box-shadow:none}
.cf-order-bump-2 .ob2-input:checked + .ob2-box svg{opacity:1;transform:scale(1)}
.cf-order-bump-2 .ob2-input:focus-visible + .ob2-box{outline:3px solid var(--field-focus,var(--accent,oklch(0.5 0.17 257)));outline-offset:3px}
.cf-order-bump-2 .ob2-thumb{grid-area:thumb;display:block;width:72px;height:72px;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--ob2-shadow-c) l c h / .3)) drop-shadow(0 6px 8px oklch(from var(--ob2-shadow-c) l c h / .18));transition:width .3s ease,height .3s ease}
.cf-order-bump-2[data-checked] .ob2-thumb{width:56px;height:56px}
.cf-order-bump-2 .ob2-text{grid-area:text;display:flex;flex-direction:column;gap:4px;min-width:0;padding-block:16px}
.cf-order-bump-2 .ob2-yes{font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.2;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-wrap:balance}
.cf-order-bump-2 .ob2-sentence{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-weight:400;text-wrap:pretty}
.cf-order-bump-2 .ob2-added{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--success,oklch(0.5 0.14 150))}
.cf-order-bump-2 .ob2-price{grid-area:price;display:flex;flex-direction:column;align-items:flex-end;gap:4px;padding-block:16px;text-align:right}
.cf-order-bump-2 .ob2-just{font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;letter-spacing:-0.01em;font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-order-bump-2 .ob2-words{max-width:11rem;font-size:.9375rem;line-height:1.35;font-weight:600;text-wrap:pretty}
.cf-order-bump-2 .ob2-swap{animation:ob2-swap .32s var(--ob2-ease) both}
/* hover and press */
.cf-order-bump-2:not([data-disabled]):not([data-checked]) .ob2-bump:hover,
.cf-order-bump-2[data-hover]:not([data-disabled]):not([data-checked]) .ob2-bump{border-color:oklch(from var(--ob2-bump-ink) l c h / .9);box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 256 / .22),0 4px 10px -2px oklch(0.22 0.03 256 / .2))}
.cf-order-bump-2:not([data-disabled]):not([data-checked]) .ob2-line:hover .ob2-box,
.cf-order-bump-2[data-hover]:not([data-disabled]):not([data-checked]) .ob2-box{background:color-mix(in oklch,var(--ob2-bump-ink) 10%,var(--field,var(--card,#fff)));border-width:2.5px;transform:scale(1.06)}
.cf-order-bump-2[data-checked]:not([data-disabled]) .ob2-bump:hover,
.cf-order-bump-2[data-hover][data-checked]:not([data-disabled]) .ob2-bump{background:color-mix(in oklch,var(--ink,#101828) 3%,var(--card,#fff))}
.cf-order-bump-2:not([data-disabled]) .ob2-line:active .ob2-box{transform:scale(.94)}
/* disabled */
.cf-order-bump-2[data-disabled] .ob2-bump{background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#fff));color:var(--ink,#101828);border-color:oklch(from var(--ink,#101828) l c h / .3);box-shadow:none}
.cf-order-bump-2[data-disabled] .ob2-tick{background:color-mix(in oklch,var(--ink,#101828) 8%,var(--card,#fff))}
.cf-order-bump-2[data-disabled][data-checked] .ob2-tick{background:transparent}
.cf-order-bump-2[data-disabled] .ob2-line,.cf-order-bump-2[data-disabled] .ob2-input{cursor:not-allowed}
.cf-order-bump-2[data-disabled] .ob2-box{background:color-mix(in oklch,var(--ink,#101828) 8%,var(--card,#fff));border-color:oklch(from var(--ink,#101828) l c h / .35);box-shadow:none}
.cf-order-bump-2[data-disabled] .ob2-thumb{filter:grayscale(1) drop-shadow(0 2px 3px oklch(from var(--ob2-shadow-c) l c h / .25))}
.cf-order-bump-2 .ob2-dnote{margin:0;padding:0 var(--ob2-pad) 16px 80px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4a5565);text-wrap:pretty}
.cf-order-bump-2 .ob2-dnote svg{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em}
/* the end of the path: question + button */
.cf-order-bump-2 .ob2-cta{grid-row:4;margin-top:32px;text-align:center}
.cf-order-bump-2 .ob2-question{margin:0 0 16px;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-wrap:balance;color:var(--ink,#101828)}
.cf-order-bump-2 .ob2-btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:var(--ob2-btn-h);margin:0;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2,#b42318)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#fff));font-family:var(--button-font,var(--font-display,Arial,sans-serif));font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-wrap:balance;text-decoration:none;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .16) c h),0 1px 2px oklch(from var(--ob2-shadow-c) l c h / .3),0 8px 16px -6px oklch(from var(--ob2-shadow-c) l c h / .35));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-order-bump-2 .ob2-btn:hover{background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2,#b42318)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l + .1) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .2) c h),0 1px 2px oklch(from var(--ob2-shadow-c) l c h / .32),0 10px 20px -6px oklch(from var(--ob2-shadow-c) l c h / .42))}
.cf-order-bump-2 .ob2-btn:active{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .16) c h),0 1px 2px oklch(from var(--ob2-shadow-c) l c h / .3)}
.cf-order-bump-2 .ob2-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent,oklch(0.5 0.17 257)));outline-offset:3px}
.cf-order-bump-2 .ob2-reassure{margin:16px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4a5565);text-wrap:pretty}
.cf-order-bump-2 .ob2-reassure svg{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-order-bump-2 .ob2-seg{display:inline-block;max-width:100%;hyphens:none}
/* reveal */
.cf-order-bump-2 .ob2-in{animation:ob2-rise .45s var(--ob2-ease) both;animation-delay:var(--d,0s)}
@keyframes ob2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ob2-swap{from{opacity:.4}to{opacity:1}}
/* the path rail: stops at the item, the line, the total, and the button */
@media (min-width:640px){
.cf-order-bump-2 .ob2-ledger{padding-inline:40px}
.cf-order-bump-2 .ob2-ledger::before{content:'';position:absolute;z-index:0;left:11px;width:2px;top:calc(var(--ob2-img) + 30px);bottom:calc(var(--ob2-btn-h) / 2);border-radius:2px;background:oklch(from var(--ink,#101828) l c h / .16)}
.cf-order-bump-2 .ob2-stop::after{content:'';position:absolute;left:var(--ob2-dot-x,-34px);top:calc(50% - 6px);width:12px;height:12px;border-radius:50%;border:2px solid var(--ob2-stop);background:var(--ob2-stop);transition:background-color .3s ease}
.cf-order-bump-2 .ob2-top::after{top:calc(var(--ob2-img) + 24px)}
.cf-order-bump-2 .ob2-total{--ob2-dot-x:-46px}
.cf-order-bump-2 .ob2-bump{--ob2-dot-x:-36px}
.cf-order-bump-2:not([data-checked]) .ob2-bump::after{background:var(--surface,#fff)}
.cf-order-bump-2 .ob2-cta::after{top:auto;bottom:calc(var(--ob2-btn-h) / 2 - 8px);left:-36px;width:16px;height:16px}
}
/* phones: full width, the line stacks, the tick target stays a full-height column */
@media (max-width:559px){
.cf-order-bump-2 .ob2-bump[data-flip] .ob2-line{grid-template-columns:56px minmax(0,1fr);grid-template-areas:'tick text' 'tick price';column-gap:14px;padding-right:16px}
.cf-order-bump-2 .ob2-thumb{display:none}
.cf-order-bump-2 .ob2-text{padding-bottom:8px}
.cf-order-bump-2 .ob2-price{align-items:flex-start;text-align:left;padding-top:0}
.cf-order-bump-2[data-checked] .ob2-bump[data-flip] .ob2-line{grid-template-columns:56px minmax(0,1fr) auto;grid-template-areas:'tick text price'}
.cf-order-bump-2[data-checked] .ob2-text{padding-bottom:16px}
.cf-order-bump-2[data-checked] .ob2-price{align-items:flex-end;text-align:right;padding-top:16px}
.cf-order-bump-2 .ob2-row{padding-inline:20px}
.cf-order-bump-2 .ob2-total{margin-inline:8px;padding:14px 16px}
.cf-order-bump-2 .ob2-dnote{padding-left:70px;padding-right:16px}
.cf-order-bump-2 .ob2-btn{padding-inline:16px}
}
@media (prefers-reduced-motion:reduce){
.cf-order-bump-2 .ob2-in,.cf-order-bump-2 .ob2-swap{animation:none}
.cf-order-bump-2 .ob2-col,.cf-order-bump-2 .ob2-box,.cf-order-bump-2 .ob2-box svg,.cf-order-bump-2 .ob2-bump,.cf-order-bump-2 .ob2-tick,.cf-order-bump-2 .ob2-thumb,.cf-order-bump-2 .ob2-btn,.cf-order-bump-2 .ob2-stop::after{transition:none}
}
`
pieces/offer/order-bump-2/specimen.tsx 54 lines
import __studioImage1cbf8842 from "../assets/2af4c3fcbbdc8af9.webp";
import __studioImage67320c2b from "../assets/bf14edd97d3ba22e.webp";
// Specimen: the fictional Ember Peak skillet on a mini receipt, with its seasoning oil waiting as the pending bump line.
import * as React from "react"
import { OrderBump2 } from "../order-bump-2"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled"]
type SpecimenState = React.ComponentProps<typeof OrderBump2>["state"]
export default function OrderBump2Specimen({ state = "default" }: { state?: SpecimenState }) {
return (
<OrderBump2
state={state}
headline="Cook on it the day it arrives"
headlineMark="the day it arrives"
lines={[
"Bare cast iron wants a seasoning coat before the first sear.",
"Tick the line under your receipt and the oil ships in the same box.",
]}
punch="Done."
item={{
name: "Ember Peak 12-inch Skillet",
detail: "Hand-poured cast iron · Helper handle",
price: 89,
image: slot(
"product",
__studioImage1cbf8842,
),
imageAlt: "Ember Peak 12-inch cast iron skillet",
}}
bumpName="Ember Peak Seasoning Oil"
bumpYes="Yes, add the seasoning oil"
bumpSentence="One bottle builds the slick, rust-proof coat your skillet needs before the first sear."
bumpPrice={14}
bumpPriceLabel="Just {price}"
bumpPriceWords="less than one takeout lunch"
bumpImage={slot(
"item-1",
__studioImage67320c2b,
)}
bumpImageAlt="Ember Peak Seasoning Oil bottle"
addedNote="Added · untick to remove"
totalLabel="Total today"
totalNote="Tick the line below to add the seasoning oil"
totalNoteAdded="Includes the seasoning oil"
question="Ready to cook on it this weekend?"
actionLabel="I'm ready, send my skillet"
reassurance={`{total} today · ${defaults.sample.guarantee}`}
/>
)
}
| Name | Type | Details |
|---|---|---|
state OptionalOrderBump2 |
"default" | "hover" | "active" | "disabled" |
Default "default"
|
headline OptionalOrderBump2 |
string |
Default "Cook on it the day it arrives"
|
headlineMark OptionalOrderBump2 |
string |
Default "the day it arrives"
|
lines OptionalOrderBump2 |
string[] |
Default DEFAULT_LINES
|
punch OptionalOrderBump2 |
string |
Default "Done."
|
item OptionalOrderBump2 |
OrderBump2Item |
Default DEFAULT_ITEM
|
bumpName OptionalOrderBump2 |
string |
Default "Ember Peak Seasoning Oil"
|
bumpYes OptionalOrderBump2 |
string |
Default "Yes, add the seasoning oil"
|
bumpSentence OptionalOrderBump2 |
string |
Default "One bottle builds the slick, rust-proof coat your skillet needs before the first sear."
|
bumpPrice OptionalOrderBump2 |
number |
Default 14
|
bumpPriceLabel OptionalOrderBump2 |
string |
Default "Just {price}"
|
bumpPriceWords OptionalOrderBump2 |
string |
|
bumpImage OptionalOrderBump2 |
string |
|
bumpImageAlt OptionalOrderBump2 |
string |
Default ""
|
addedNote OptionalOrderBump2 |
string |
Default "Added · untick to remove"
|
totalLabel OptionalOrderBump2 |
string |
Default "Total today"
|
totalNote OptionalOrderBump2 |
string |
Default "Tick the line below to add {name}"
|
totalNoteAdded OptionalOrderBump2 |
string |
Default "Includes {name}"
|
question OptionalOrderBump2 |
string |
Default "Ready to cook on it this weekend?"
|
actionLabel OptionalOrderBump2 |
string |
Default "I'm ready, send my skillet"
|
reassurance OptionalOrderBump2 |
string |
Default "{total} today · Secure checkout"
|
disabledNote OptionalOrderBump2 |
string |
Default "This add-on isn't available on this order."
|
currency OptionalOrderBump2 |
string |
Default "USD"
|
locale OptionalOrderBump2 |
string |
Default "en-US"
|
href OptionalOrderBump2 |
string |
|
onAction OptionalOrderBump2 |
(detail: OrderBump2Detail) => void |
|
checked OptionalOrderBump2 |
boolean |
|
defaultChecked OptionalOrderBump2 |
boolean |
|
onChange OptionalOrderBump2 |
(checked: boolean, detail: OrderBump2Detail) => void |
|
disabled OptionalOrderBump2 |
boolean |
Default false
|
id OptionalOrderBump2 |
string |
|
className OptionalOrderBump2 |
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.
--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- 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.
product- The main product shot or cover (ebook, kit, bottle).
-
2af4c3fcbbdc8af9.webp
image/webp · 102 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
bf14edd97d3ba22e.webp
image/webp · 27 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f211b3080387e46d.webp
image/webp · 105 KB