Sticky Buy Box 1
Sticky buy box: the product, short stack, price and order button stay in view beside the letter, then dock as a bottom bar on phones so the action never scrolls away.
Use it in a prompt
Use offer/sticky-buy-box 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/sticky-buy-box.tsx. - Import it and pass your copy and images (Props tab):
import { StickyBuyBox } from "@/components/funneldna/offer/sticky-buy-box"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/sticky-buy-box/component.tsx 589 lines
// layout: sticky-offer-side
// Sticky buy box: the product, short stack, price and order button stay in view beside the letter, then dock as a bottom bar on phones so the action never scrolls away.
import * as React from "react"
import { ChevronUp, ShieldCheck } from "lucide-react"
export type StickyBuyBoxItem = {
name: string
/** One short line under the item name. Hidden on phones and short screens. */
detail?: string
/** Supplied value for this item, e.g. "$49". */
value?: string
/** Item photo (slot item-n). */
image?: string
/** Item photo alt text. Defaults to the item name. */
imageAlt?: string
}
export type StickyBuyBoxProps = {
productName?: string
/** Product composite on a transparent background (slot "product"). */
productImage?: string
/** Product image alt text. Defaults to the product name. */
productImageAlt?: string
/** Short sales line under the product name. */
pitch?: string
/** Phrase inside `pitch` that gets the marker highlight. */
highlight?: string
items?: StickyBuyBoxItem[]
/** Label before the struck total value. */
totalValueLabel?: string
/** Supplied total value of the stack, shown struck above the price as the anchor. */
totalValue?: string
price?: string
/** Small line set under the price. */
priceNote?: string
/** Short copy line that points at the button. */
instruction?: string
/** Order button label. */
label?: string
/** Small line inside the order button, under the label. Hidden on phones. */
sublabel?: string
/** Guarantee headline. Empty hides the guarantee. */
guarantee?: string
/** One line under the guarantee headline. */
guaranteeNote?: string
/** Guarantee seal on a transparent background (slot "seal-guarantee"). */
sealImage?: string
sealImageAlt?: string
/** Phone bar summary. Placeholders: {count} (number of items), {value} (totalValue). */
insideSummary?: string
/** Accessible name of the box. Placeholder: {name} (productName). */
regionLabel?: string
/** Checkout destination. Renders the order button as a link. */
href?: string
/** Called when the order button is clicked. */
onAction?: (event: React.MouseEvent<HTMLElement>) => void
disabled?: boolean
state?: "default" | "hover" | "active" | "disabled"
className?: string
}
const DEFAULT_ITEMS: StickyBuyBoxItem[] = [
{ name: "Funnel Planning Guide", detail: "Map your offer and the pages your funnel needs.", value: "$49" },
{ name: "Page Copy Workbook", detail: "Draft your headline, offer, and call to action.", value: "$29" },
{ name: "Launch Checklist", detail: "Review the links, forms, and next steps before launch.", value: "$19" },
]
/**
* Use it as a grid child beside the letter so it sticks to the top. On phones, place it after the letter in the
* same grid so it docks at the bottom while the letter scrolls. Ancestors must not set overflow: hidden.
* Theme: colours, faces, button, card and marker read the theme-contract tokens (hex only as a var() fallback);
* the marker keeps the documented yellow default (--marker).
*/
export function StickyBuyBox(props: StickyBuyBoxProps) {
const {
productName = "The Funnel Starter Kit",
productImage,
productImageAlt,
pitch = "Get the guide, workbook, and checklist in one download. One payment. Yours to keep.",
highlight = "in one download",
items = DEFAULT_ITEMS,
totalValueLabel = "Total value",
totalValue = "$97",
price = "$47",
priceNote = "one-time payment",
instruction = "Click below to get the complete kit.",
label = "Order now",
sublabel = "Secure checkout · Instant download",
guarantee = "30-day money-back guarantee",
guaranteeNote = "Not the right fit? Ask for a full refund within 30 days.",
sealImage,
sealImageAlt = "",
insideSummary = "{count} items · {value} value",
regionLabel = "Order {name}",
href,
onAction,
disabled = false,
state = "default",
className,
} = props
const rootRef = React.useRef<HTMLElement>(null)
const toggleRef = React.useRef<HTMLButtonElement>(null)
const drawerId = React.useId()
const [open, setOpen] = React.useState(false)
const [stuck, setStuck] = React.useState(false)
// Desktop only: mark the box as stuck once it pins to its sticky top, so the hero image can shrink.
React.useEffect(() => {
const el = rootRef.current
if (!el || typeof window === "undefined") return
const mq = window.matchMedia("(min-width: 721px)")
let frame = 0
const measure = () => {
frame = 0
if (!mq.matches) {
setStuck(false)
return
}
const top = parseFloat(getComputedStyle(el).top) || 0
const rect = el.getBoundingClientRect()
const parent = el.parentElement?.getBoundingClientRect()
const next = Math.abs(rect.top - top) < 1.5 && !!parent && parent.top < top - 1
setStuck((prev) => (prev === next ? prev : next))
}
const schedule = () => {
if (!frame) frame = window.requestAnimationFrame(measure)
}
measure()
document.addEventListener("scroll", schedule, { capture: true, passive: true })
window.addEventListener("resize", schedule)
mq.addEventListener("change", schedule)
return () => {
document.removeEventListener("scroll", schedule, { capture: true })
window.removeEventListener("resize", schedule)
mq.removeEventListener("change", schedule)
if (frame) window.cancelAnimationFrame(frame)
}
}, [])
const isDisabled = disabled || state === "disabled"
const { cur, amount, rest } = splitPrice(price)
const summary = insideSummary.replace("{count}", String(items.length)).replace("{value}", totalValue)
const btnClass = ["sbb-btn", state === "hover" && "is-hover", state === "active" && "is-active"].filter(Boolean).join(" ")
const buttonContent = (
<>
<span className="sbb-label">{label}</span>
{sublabel && <span className="sbb-sub">{sublabel}</span>}
</>
)
const action =
!isDisabled && href ? (
<a className={btnClass} href={href} onClick={onAction}>
{buttonContent}
</a>
) : (
<button type="button" className={btnClass} disabled={isDisabled} onClick={onAction}>
{buttonContent}
</button>
)
const guaranteeBlock = (variant: "main" | "drawer") =>
guarantee ? (
<div className={`sbb-guar sbb-guar--${variant}`}>
{sealImage ? (
<img className="sbb-seal" src={sealImage} alt={sealImageAlt} width={112} height={112} loading="lazy" />
) : (
<ShieldCheck className="sbb-shield" aria-hidden="true" />
)}
<div className="sbb-guar-txt">
<p className="sbb-guar-title">{guarantee}</p>
{guaranteeNote && <p className="sbb-guar-note">{guaranteeNote}</p>}
</div>
</div>
) : null
const onKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {
if (event.key === "Escape" && open) {
setOpen(false)
toggleRef.current?.focus()
}
}
return (
<aside
ref={rootRef}
className={["cf-sticky-buy-box", className].filter(Boolean).join(" ")}
aria-label={regionLabel.replace("{name}", productName)}
data-has-image={productImage ? "" : undefined}
data-open={open ? "" : undefined}
data-stuck={stuck ? "" : undefined}
data-disabled={isDisabled ? "" : undefined}
onKeyDown={onKeyDown}
>
<style>{CSS}</style>
<div className="sbb-card">
{productImage && (
<div className="sbb-hero">
<img src={productImage} alt={productImageAlt ?? productName} width={720} height={540} />
</div>
)}
<h3 className="sbb-title">{productName}</h3>
{pitch && <p className="sbb-pitch">{withMarker(pitch, highlight)}</p>}
<button
ref={toggleRef}
type="button"
className="sbb-toggle"
aria-expanded={open}
aria-controls={drawerId}
onClick={() => setOpen((o) => !o)}
>
<span className="sbb-toggle-txt">
<span className="sbb-toggle-name">{productName}</span>
<span className="sbb-toggle-sum">{summary}</span>
</span>
<ChevronUp className="sbb-chev" aria-hidden="true" size={22} />
</button>
<div className="sbb-drawer" id={drawerId}>
<div className="sbb-drawer-in">
<ul className="sbb-stack">
{items.map((item, i) => (
<li key={`${item.name}-${i}`} className={item.image ? "sbb-row" : "sbb-row sbb-row--plain"}>
{item.image && (
<img className="sbb-thumb" src={item.image} alt={item.imageAlt ?? item.name} width={104} height={104} loading="lazy" />
)}
<div className="sbb-row-txt">
<p className="sbb-name">{item.name}</p>
{item.detail && <p className="sbb-detail">{item.detail}</p>}
</div>
{item.value && <span className="sbb-value">{item.value}</span>}
</li>
))}
</ul>
{guaranteeBlock("drawer")}
</div>
</div>
<div className={productImage ? "sbb-buy" : "sbb-buy sbb-buy--plain"}>
{productImage && <img className="sbb-mini" src={productImage} alt="" width={88} height={88} />}
<div className="sbb-deal">
{totalValue && (
<p className="sbb-anchor">
<span>{totalValueLabel}</span>
<s className="sbb-anchor-amount">{totalValue}</s>
</p>
)}
<p className="sbb-price">
{cur && <span className="sbb-cur">{cur}</span>}
<span className="sbb-amount">{amount}</span>
{rest && <span className="sbb-rest">{rest}</span>}
</p>
{priceNote && <p className="sbb-note">{priceNote}</p>}
</div>
<div className="sbb-act">
{instruction && <p className="sbb-instruct">{instruction}</p>}
{action}
</div>
</div>
{guaranteeBlock("main")}
</div>
</aside>
)
}
export default StickyBuyBox
/** Splits "$47.00/mo" into currency, amount and trailing text so each can be sized on its own. */
function splitPrice(value: string) {
const match = value.trim().match(/^([^0-9]*)([0-9][0-9.,]*)(.*)$/)
if (!match) return { cur: "", amount: value, rest: "" }
return { cur: match[1].trim(), amount: match[2], rest: match[3].trim() }
}
/** Wraps the first occurrence of `phrase` in the marker highlight. */
function withMarker(text: string, phrase?: string) {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<mark className="sbb-mark">{phrase}</mark>
{text.slice(at + phrase.length)}
</>
)
}
const CSS = `
.cf-sticky-buy-box{
--sbb-top:var(--sticky-top,20px);
--sbb-ink:var(--ink,#172033);
--sbb-muted:var(--muted,#5b6474);
--sbb-card-bg:var(--card,#ffffff);
--sbb-focus:var(--field-focus,var(--accent,#2f5bd3));
--sbb-btn:var(--button-bg,var(--cta,#d43c2f));
--sbb-btn-2:var(--button-bg-2,var(--cta-2,#b8302a));
--sbb-btn-ink:var(--button-ink,var(--cta-ink,#ffffff));
--sbb-btn2-bg:var(--button-2-bg,var(--secondary,#e5e8ee));
--sbb-btn2-ink:var(--button-2-ink,var(--secondary-ink,#172033));
--sbb-radius:var(--card-radius,var(--radius,18px));
--sbb-shadow:var(--shadow,oklch(0.22 0.03 256));
--sbb-well:color-mix(in oklch,var(--sbb-ink) 4%,var(--sbb-card-bg));
--sbb-line:oklch(from var(--sbb-ink) l c h / 0.12);
--sbb-marker-base:oklch(from var(--warning,oklch(0.5 0.1 85)) 0.93 0.11 h);
position:sticky;
top:var(--sbb-top);
z-index:5;
align-self:start;
box-sizing:border-box;
width:100%;
max-width:var(--buy-box-width,400px);
margin-inline:auto;
font-family:var(--font-body);
color:var(--sbb-ink);
}
.cf-sticky-buy-box *,.cf-sticky-buy-box *::before,.cf-sticky-buy-box *::after{box-sizing:border-box}
.cf-sticky-buy-box[data-has-image]{padding-top:56px}
.cf-sticky-buy-box p{margin:0}
.cf-sticky-buy-box .sbb-card{
position:relative;
display:flex;
flex-direction:column;
padding:0 24px 22px;
background:var(--sbb-card-bg);
color:var(--sbb-ink);
border:1px solid var(--card-border,color-mix(in oklch,var(--sbb-ink) 12%,transparent));
border-radius:var(--sbb-radius);
box-shadow:var(--card-shadow,0 2px 3px oklch(from var(--sbb-shadow) l c h / 0.2),0 14px 26px -10px oklch(from var(--sbb-shadow) l c h / 0.34)),inset 0 1px 0 oklch(from var(--sbb-card-bg) calc(l + 0.04) c h / 0.6);
}
.cf-sticky-buy-box:not([data-has-image]) .sbb-card{padding-top:24px}
.cf-sticky-buy-box .sbb-hero{
display:flex;
justify-content:center;
align-items:flex-end;
height:200px;
margin:-56px -12px 8px;
pointer-events:none;
}
.cf-sticky-buy-box .sbb-hero img{
display:block;
height:100%;
width:auto;
max-width:100%;
object-fit:contain;
object-position:center bottom;
filter:drop-shadow(0 2px 2px oklch(from var(--sbb-shadow) l c h / 0.28)) drop-shadow(0 10px 12px oklch(from var(--sbb-shadow) l c h / 0.22));
}
.cf-sticky-buy-box[data-stuck] .sbb-hero{height:120px}
.cf-sticky-buy-box .sbb-title{
margin:6px 0 10px;
font-family:var(--font-display);
font-weight:var(--display-weight,900);
text-transform:var(--display-case,none);
letter-spacing:var(--display-tracking,-0.02em);
font-size:1.75rem;
line-height:1.08;
text-align:center;
text-wrap:balance;
color:var(--sbb-ink);
}
.cf-sticky-buy-box .sbb-pitch{
font-size:1.0625rem;
line-height:1.5;
font-weight:500;
text-align:center;
text-wrap:pretty;
color:var(--sbb-ink);
}
.cf-sticky-buy-box .sbb-mark{
color:oklch(from var(--sbb-ink) 0.22 c h);
background:linear-gradient(transparent 8%,var(--marker,#fae37c) 8% 95%,transparent 95%),linear-gradient(transparent 8%,var(--sbb-marker-base) 8% 95%,transparent 95%);
padding:0 .14em;
margin:0 -.04em;
border-radius:.3em .5em .35em .45em;
-webkit-box-decoration-break:clone;
box-decoration-break:clone;
font-weight:700;
}
.cf-sticky-buy-box .sbb-toggle{
display:none;
width:100%;
align-items:center;
justify-content:space-between;
gap:12px;
min-height:48px;
padding:8px 12px;
border:0;
border-radius:max(8px,calc(var(--sbb-radius) - 8px));
background:var(--button-2-bg,var(--sbb-well));
color:var(--button-2-ink,var(--sbb-ink));
font:inherit;
text-align:left;
cursor:pointer;
}
.cf-sticky-buy-box .sbb-toggle:hover{background:color-mix(in oklch,var(--sbb-ink) 4%,var(--button-2-bg,var(--sbb-well)))}
.cf-sticky-buy-box .sbb-toggle:focus-visible{outline:3px solid var(--sbb-focus);outline-offset:2px}
.cf-sticky-buy-box .sbb-toggle-txt{display:flex;flex-direction:column;min-width:0}
.cf-sticky-buy-box .sbb-toggle-name{font-weight:800;font-size:.9375rem;line-height:1.25;text-wrap:pretty}
.cf-sticky-buy-box .sbb-toggle-sum{font-size:.875rem;line-height:1.3;color:var(--sbb-muted)}
.cf-sticky-buy-box .sbb-chev{flex:none;color:currentColor}
.cf-sticky-buy-box[data-open] .sbb-chev{transform:rotate(180deg)}
.cf-sticky-buy-box .sbb-drawer{display:grid;grid-template-rows:1fr}
.cf-sticky-buy-box .sbb-drawer-in{min-height:0}
.cf-sticky-buy-box .sbb-stack{list-style:none;margin:20px 0 0;padding:0;display:grid;gap:14px}
.cf-sticky-buy-box .sbb-row{display:grid;grid-template-columns:52px minmax(0,1fr) auto;column-gap:12px;align-items:start}
.cf-sticky-buy-box .sbb-row--plain{grid-template-columns:minmax(0,1fr) auto}
.cf-sticky-buy-box .sbb-thumb{display:block;width:52px;height:52px;object-fit:cover;border-radius:10px;outline:1px solid var(--sbb-line);outline-offset:-1px}
.cf-sticky-buy-box .sbb-name{font-weight:700;font-size:1rem;line-height:1.3;text-wrap:pretty;color:var(--sbb-ink)}
.cf-sticky-buy-box .sbb-detail{margin-top:2px;font-size:.875rem;line-height:1.4;color:var(--sbb-muted);text-wrap:pretty}
.cf-sticky-buy-box .sbb-value{font-weight:800;font-size:1rem;line-height:1.3;font-variant-numeric:tabular-nums;color:var(--sbb-ink)}
.cf-sticky-buy-box .sbb-mini{display:none}
.cf-sticky-buy-box .sbb-deal{
margin-top:20px;
padding:16px 18px 18px;
display:flex;
flex-direction:column;
align-items:center;
text-align:center;
background:var(--sbb-well);
border-radius:max(8px,calc(var(--sbb-radius) - 6px));
}
.cf-sticky-buy-box .sbb-anchor{
display:inline-flex;
align-items:baseline;
justify-content:center;
gap:8px;
font-size:.9375rem;
font-weight:600;
line-height:1.3;
color:var(--sbb-muted);
}
.cf-sticky-buy-box .sbb-anchor-amount{
font-family:var(--font-display);
font-weight:800;
font-size:1.0625rem;
font-variant-numeric:tabular-nums;
color:var(--sbb-ink);
text-decoration-line:line-through;
text-decoration-color:var(--danger,oklch(0.5 0.17 27));
text-decoration-thickness:2px;
}
.cf-sticky-buy-box .sbb-price{
display:flex;
align-items:flex-start;
justify-content:center;
margin-top:8px;
font-family:var(--font-display);
font-weight:var(--display-weight,900);
color:var(--sbb-ink);
line-height:1;
font-variant-numeric:tabular-nums;
}
.cf-sticky-buy-box .sbb-cur{font-size:1.5rem;margin:.28em .06em 0 0}
.cf-sticky-buy-box .sbb-amount{font-size:4rem;line-height:.92;letter-spacing:-.035em}
.cf-sticky-buy-box .sbb-rest{font-size:1.5rem;margin:.28em 0 0 .08em}
.cf-sticky-buy-box .sbb-note{margin-top:12px;font-size:.875rem;line-height:1.2;font-weight:600;color:var(--sbb-muted)}
.cf-sticky-buy-box .sbb-act{margin-top:18px;display:flex;flex-direction:column;align-items:stretch}
.cf-sticky-buy-box .sbb-instruct{
margin:0 0 12px;
font-weight:700;
font-size:1rem;
line-height:1.35;
text-align:center;
text-wrap:balance;
color:var(--sbb-ink);
}
.cf-sticky-buy-box .sbb-btn{
appearance:none;
border:0;
cursor:pointer;
text-decoration:none;
width:100%;
min-height:66px;
display:inline-flex;
flex-direction:column;
align-items:center;
justify-content:center;
gap:3px;
padding:12px 18px 14px;
border-radius:var(--button-radius,var(--radius,14px));
background:linear-gradient(oklch(from var(--sbb-btn) calc(l + 0.04) c h),var(--sbb-btn-2));
color:var(--sbb-btn-ink);
font-family:var(--button-font,var(--font-display));
text-transform:var(--button-case,none);
text-align:center;
text-shadow:var(--button-text-shadow,none);
box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--sbb-btn) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--sbb-btn) calc(l - 0.16) c h),0 1px 2px oklch(from var(--sbb-shadow) l c h / 0.35),0 6px 12px -4px oklch(from var(--sbb-shadow) l c h / 0.4));
}
.cf-sticky-buy-box .sbb-btn:hover:not(:disabled),.cf-sticky-buy-box .sbb-btn.is-hover:not(:disabled){
transform:translateY(-1px);
background:linear-gradient(oklch(from var(--sbb-btn) calc(l - 0.02) c h),oklch(from var(--sbb-btn-2) calc(l - 0.06) c h));
}
.cf-sticky-buy-box .sbb-btn:active:not(:disabled),.cf-sticky-buy-box .sbb-btn.is-active:not(:disabled){
transform:translateY(1px);
background:linear-gradient(oklch(from var(--sbb-btn) calc(l - 0.06) c h),oklch(from var(--sbb-btn-2) calc(l - 0.1) c h));
box-shadow:inset 0 1px 0 oklch(from var(--sbb-btn) calc(l + 0.08) c h / 0.5),inset 0 -1px 0 oklch(from var(--sbb-btn) calc(l - 0.16) c h),0 1px 1px oklch(from var(--sbb-shadow) l c h / 0.35);
}
.cf-sticky-buy-box .sbb-btn:focus-visible{outline:3px solid var(--sbb-focus);outline-offset:3px}
.cf-sticky-buy-box .sbb-btn:disabled{
cursor:not-allowed;
background:var(--sbb-btn2-bg);
color:var(--sbb-btn2-ink);
text-shadow:none;
box-shadow:var(--button-2-shadow, var(--shadow-sm));
}
.cf-sticky-buy-box .sbb-label{font-size:1.4rem;font-weight:var(--button-weight,800);line-height:1.1;letter-spacing:-.01em}
.cf-sticky-buy-box .sbb-sub{font-family:var(--font-body);font-size:.875rem;font-weight:600;line-height:1.3;text-transform:none;text-wrap:pretty}
.cf-sticky-buy-box .sbb-guar{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:16px}
.cf-sticky-buy-box .sbb-guar--drawer{display:none}
.cf-sticky-buy-box .sbb-seal{flex:none;width:56px;height:56px;object-fit:contain;filter:drop-shadow(0 1px 1px oklch(from var(--sbb-shadow) l c h / 0.3)) drop-shadow(0 4px 6px oklch(from var(--sbb-shadow) l c h / 0.2))}
.cf-sticky-buy-box .sbb-shield{flex:none;width:30px;height:30px;color:var(--success,oklch(0.5 0.13 150))}
.cf-sticky-buy-box .sbb-guar-txt{min-width:0}
.cf-sticky-buy-box .sbb-guar-title{font-weight:800;font-size:.9375rem;line-height:1.3;color:var(--sbb-ink)}
.cf-sticky-buy-box .sbb-guar-note{margin-top:2px;font-size:.875rem;line-height:1.4;color:var(--sbb-muted);text-wrap:pretty}
@media (min-width:721px) and (max-height:900px){
.cf-sticky-buy-box .sbb-detail{display:none}
.cf-sticky-buy-box .sbb-hero{height:170px}
}
@media (min-width:721px) and (max-height:780px){
.cf-sticky-buy-box .sbb-pitch,.cf-sticky-buy-box .sbb-guar-note{display:none}
.cf-sticky-buy-box .sbb-hero{height:140px}
.cf-sticky-buy-box .sbb-amount{font-size:3.25rem}
}
@media (max-width:720px){
.cf-sticky-buy-box{top:auto;bottom:max(8px,env(safe-area-inset-bottom));align-self:end;max-width:none;z-index:30}
.cf-sticky-buy-box[data-has-image]{padding-top:0}
.cf-sticky-buy-box .sbb-card,.cf-sticky-buy-box:not([data-has-image]) .sbb-card{
padding:10px;
box-shadow:var(--card-shadow,0 1px 2px oklch(from var(--sbb-shadow) l c h / 0.22),0 -6px 18px -8px oklch(from var(--sbb-shadow) l c h / 0.34),0 8px 16px -8px oklch(from var(--sbb-shadow) l c h / 0.3)),inset 0 1px 0 oklch(from var(--sbb-card-bg) calc(l + 0.04) c h / 0.6);
}
.cf-sticky-buy-box .sbb-hero,.cf-sticky-buy-box .sbb-title,.cf-sticky-buy-box .sbb-pitch,.cf-sticky-buy-box .sbb-instruct,.cf-sticky-buy-box .sbb-sub,.cf-sticky-buy-box .sbb-anchor,.cf-sticky-buy-box .sbb-guar--main,.cf-sticky-buy-box .sbb-detail{display:none}
.cf-sticky-buy-box .sbb-toggle{display:flex}
.cf-sticky-buy-box .sbb-guar--drawer{display:flex;justify-content:flex-start;margin-top:14px;padding:0 4px 4px}
.cf-sticky-buy-box .sbb-seal{width:44px;height:44px}
.cf-sticky-buy-box .sbb-drawer{grid-template-rows:0fr;visibility:hidden}
.cf-sticky-buy-box[data-open] .sbb-drawer{grid-template-rows:1fr;visibility:visible}
.cf-sticky-buy-box .sbb-drawer-in{overflow:hidden}
.cf-sticky-buy-box[data-open] .sbb-drawer-in{max-height:46dvh;overflow-y:auto;overscroll-behavior:contain}
.cf-sticky-buy-box .sbb-stack{margin-top:12px;gap:10px;padding:0 4px}
.cf-sticky-buy-box .sbb-row{grid-template-columns:40px minmax(0,1fr) auto;align-items:center}
.cf-sticky-buy-box .sbb-row--plain{grid-template-columns:minmax(0,1fr) auto}
.cf-sticky-buy-box .sbb-thumb{width:40px;height:40px;border-radius:8px}
.cf-sticky-buy-box .sbb-buy{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;margin-top:10px}
.cf-sticky-buy-box .sbb-buy--plain{grid-template-columns:minmax(0,1fr) auto}
.cf-sticky-buy-box .sbb-mini{display:block;width:44px;height:44px;object-fit:contain;filter:drop-shadow(0 1px 1px oklch(from var(--sbb-shadow) l c h / 0.3)) drop-shadow(0 3px 4px oklch(from var(--sbb-shadow) l c h / 0.2))}
.cf-sticky-buy-box .sbb-deal{margin:0;padding:0;background:none;min-width:0;align-items:flex-start;text-align:left}
.cf-sticky-buy-box .sbb-price{margin-top:0;justify-content:flex-start}
.cf-sticky-buy-box .sbb-cur{font-size:1rem}
.cf-sticky-buy-box .sbb-amount{font-size:2.25rem;line-height:1}
.cf-sticky-buy-box .sbb-note{margin-top:6px;text-wrap:balance}
.cf-sticky-buy-box .sbb-act{margin:0}
.cf-sticky-buy-box .sbb-btn{width:auto;min-height:52px;padding:10px 20px 12px;white-space:nowrap}
.cf-sticky-buy-box .sbb-label{font-size:1.125rem}
}
@media (max-width:360px){
.cf-sticky-buy-box .sbb-mini{display:none}
.cf-sticky-buy-box .sbb-buy{grid-template-columns:minmax(0,1fr) auto}
.cf-sticky-buy-box .sbb-btn{padding-inline:16px}
}
@media (prefers-reduced-motion:no-preference){
.cf-sticky-buy-box .sbb-hero{transition:height .35s cubic-bezier(.22,1,.36,1)}
.cf-sticky-buy-box .sbb-hero img{animation:sbb-rise .55s cubic-bezier(.22,1,.36,1) both}
.cf-sticky-buy-box .sbb-btn{transition:transform .15s ease,box-shadow .15s ease,background .15s ease}
.cf-sticky-buy-box .sbb-toggle{transition:background .15s ease}
.cf-sticky-buy-box .sbb-chev{transition:transform .25s ease}
}
@media (prefers-reduced-motion:no-preference) and (max-width:720px){
.cf-sticky-buy-box .sbb-drawer{transition:grid-template-rows .3s ease,visibility 0s linear .3s}
.cf-sticky-buy-box[data-open] .sbb-drawer{transition:grid-template-rows .3s ease,visibility 0s}
}
@keyframes sbb-rise{from{opacity:.82;transform:translateY(10px)}to{opacity:1;transform:none}}
`
pieces/offer/sticky-buy-box/specimen.tsx 34 lines
import __studioImaged984c772 from "../assets/1c1eadd895c77346.webp";
import __studioImage6512946b from "../assets/df5ee13f628de598.webp";
import * as React from "react"
import { StickyBuyBox, type StickyBuyBoxProps } from "../sticky-buy-box"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled"]
export default function StickyBuyBoxSpecimen({ state = "default" }: { state?: StickyBuyBoxProps["state"] }) {
const sample = defaults.sample
return (
<StickyBuyBox
productName={sample.name}
productImage={slot("product", __studioImaged984c772)}
productImageAlt="The Funnel Starter Kit: planning guide, page copy workbook and launch checklist"
pitch={sample.reason}
highlight="in one download"
items={sample.items.map((item, i) => ({
name: item.name,
detail: item.detail,
value: item.value,
image: slot(`item-${i + 1}`, item.image),
imageAlt: item.imageAlt,
}))}
totalValue={sample.regularPrice}
price={sample.price}
sublabel={sample.sublabel}
guarantee={sample.guarantee}
sealImage={slot("seal-guarantee", __studioImage6512946b)}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
productName OptionalStickyBuyBox |
string |
|
productImage OptionalStickyBuyBox |
string |
|
productImageAlt OptionalStickyBuyBox |
string |
|
pitch OptionalStickyBuyBox |
string |
|
highlight OptionalStickyBuyBox |
string |
|
items OptionalStickyBuyBox |
StickyBuyBoxItem[] |
|
totalValueLabel OptionalStickyBuyBox |
string |
|
totalValue OptionalStickyBuyBox |
string |
|
price OptionalStickyBuyBox |
string |
|
priceNote OptionalStickyBuyBox |
string |
|
instruction OptionalStickyBuyBox |
string |
|
label OptionalStickyBuyBox |
string |
|
sublabel OptionalStickyBuyBox |
string |
|
guarantee OptionalStickyBuyBox |
string |
|
guaranteeNote OptionalStickyBuyBox |
string |
|
sealImage OptionalStickyBuyBox |
string |
|
sealImageAlt OptionalStickyBuyBox |
string |
|
insideSummary OptionalStickyBuyBox |
string |
|
regionLabel OptionalStickyBuyBox |
string |
|
href OptionalStickyBuyBox |
string |
|
onAction OptionalStickyBuyBox |
(event: React.MouseEvent<HTMLElement>) => void |
|
disabled OptionalStickyBuyBox |
boolean |
|
state OptionalStickyBuyBox |
"default" | "hover" | "active" | "disabled" |
|
className OptionalStickyBuyBox |
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-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
--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).
seal-guarantee- The money-back guarantee seal, on a transparent background.
-
1c1eadd895c77346.webp
image/webp · 203 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
df5ee13f628de598.webp
image/webp · 187 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB