Page Header 1
Funnel page header: a slim masthead that names the offer, shows one trust or contact promise and keeps a small Add To Cart in reach,
Use it in a prompt
Use content/page-header 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/content/page-header.tsx. - Import it and pass your copy and images (Props tab):
import { PageHeader } from "@/components/funneldna/content/page-header"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/page-header/component.tsx 479 lines
// layout: magazine-spread
// Funnel page header: a slim masthead that names the offer, shows one trust or contact promise and keeps a small Add To Cart in reach,
// so the visitor never needs a site nav to buy.
import React from "react";
import { BadgeCheck, Clock, Lock, Phone, ShieldCheck, ShoppingCart, Truck } from "lucide-react";
export type PageHeaderTrustIcon = "shield" | "phone" | "truck" | "clock" | "lock" | "badge";
export type PageHeaderProps = {
/** Wordmark text; also the logo's alt text when a logo image is supplied. */
wordmark?: string;
/** `logo` slot image. When empty the wordmark text is shown. */
logoImage?: string;
/** Where the wordmark links (omit for plain text). */
homeHref?: string;
/** The one trust or contact line (guarantee, phone, shipping, "Family-owned since…"). */
trustText?: string;
/** A phrase inside trustText set in heavy type. Must appear verbatim in trustText. */
trustHighlight?: string;
/** Icon shown inline before the trust line. */
trustIcon?: PageHeaderTrustIcon;
/** Optional link for the trust line, e.g. "tel:+15551234567". */
trustHref?: string;
/** Show the small CTA button and the price line beside it. */
showCta?: boolean;
ctaLabel?: string;
/** Shorter label used on phones so the button stays one tidy line. */
ctaShortLabel?: string;
/** Price shown in the button's price segment. */
ctaPrice?: string;
/** Accessible name template; {label} and {price} are replaced. */
ctaAriaLabel?: string;
/** Navigation destination for the CTA (renders a link). */
href?: string;
/** Called when the CTA is clicked. */
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
/** Disables the CTA (no navigation, no callback). */
disabled?: boolean;
/** One-time price line beside the button on wide screens, e.g. "$47 today." (bold). */
priceLead?: string;
/** Words after the bold price lead, e.g. "That's it." */
priceTail?: string;
/** Small line under the price lead, e.g. "One payment · Lifetime access". */
priceNote?: string;
/** Light header on the page surface, or the dark band. */
tone?: "light" | "band";
/** Stick to the top of the viewport; gains a close shadow once the page scrolls. */
sticky?: boolean;
/** Forced CTA state for previews. */
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
export function PageHeader(props: PageHeaderProps) {
const {
wordmark = "The Funnel Starter Kit",
logoImage,
homeHref,
trustText = "Backed by our 30-day money-back guarantee",
trustHighlight = "30-day money-back guarantee",
trustIcon = "shield",
trustHref,
showCta = true,
ctaLabel = "Add To Cart",
ctaShortLabel = "Add",
ctaPrice = "$47",
ctaAriaLabel = "{label}, {price}",
href,
onAction,
disabled = false,
priceLead = "$47 today.",
priceTail = "That's it.",
priceNote = "One payment \u00b7 Lifetime access",
tone = "light",
sticky = false,
state = "default",
className,
} = props;
const isDisabled = disabled || state === "disabled";
const Icon = ICONS[trustIcon] ?? ShieldCheck;
const aria = ctaAriaLabel.replace("{label}", ctaLabel).replace("{price}", ctaPrice);
const stateAttr = state === "hover" || state === "active" ? state : undefined;
const brandInner = logoImage ? (
<img className="cf-ph-logo" src={logoImage} alt={wordmark} />
) : (
<span className="cf-ph-wordmark">{wordmark}</span>
);
const trustInner = (
<>
<Icon className="cf-ph-trust-icon" size={18} strokeWidth={2.5} aria-hidden="true" />
{renderTrust(trustText, trustHighlight)}
</>
);
const ctaInner = (
<>
<ShoppingCart className="cf-ph-cta-icon" size={20} strokeWidth={2.5} aria-hidden="true" />
<span className="cf-ph-cta-label" aria-hidden="true">
<span className="cf-ph-cta-long">{ctaLabel}</span>
<span className="cf-ph-cta-short">{ctaShortLabel}</span>
</span>
<span className="cf-ph-cta-price" aria-hidden="true">{ctaPrice}</span>
</>
);
let cta: React.ReactNode = null;
if (showCta) {
if (isDisabled) {
cta = (
<button type="button" className="cf-ph-cta" disabled aria-label={aria}>
{ctaInner}
</button>
);
} else if (href) {
cta = (
<a className="cf-ph-cta" href={href} data-state={stateAttr} aria-label={aria} onClick={onAction}>
{ctaInner}
</a>
);
} else {
cta = (
<button type="button" className="cf-ph-cta" data-state={stateAttr} aria-label={aria} onClick={onAction}>
{ctaInner}
</button>
);
}
}
return (
<header
className={["cf-page-header", className].filter(Boolean).join(" ")}
data-tone={tone}
data-sticky={sticky ? "true" : undefined}
>
<style>{CSS}</style>
<div className="cf-ph-cq">
<div className="cf-ph-inner" data-cta={showCta ? "true" : "false"}>
<div className="cf-ph-brand">
{homeHref ? (
<a className="cf-ph-brand-link" href={homeHref}>{brandInner}</a>
) : (
brandInner
)}
</div>
{trustText ? (
<p className="cf-ph-trust">
{trustHref ? (
<a className="cf-ph-trust-link" href={trustHref}>{trustInner}</a>
) : (
trustInner
)}
</p>
) : null}
{showCta ? (
<div className="cf-ph-action">
{priceLead || priceNote ? (
<p className="cf-ph-oneline">
<span className="cf-ph-oneline-top">
<strong>{priceLead}</strong> {priceTail}
</span>
{priceNote ? <span className="cf-ph-oneline-note">{priceNote}</span> : null}
</p>
) : null}
{cta}
</div>
) : null}
</div>
</div>
</header>
);
}
export default PageHeader;
const ICONS = { shield: ShieldCheck, phone: Phone, truck: Truck, clock: Clock, lock: Lock, badge: BadgeCheck };
/** Sets the highlight phrase inside the trust line in heavy type. */
function renderTrust(text: string, highlight?: string) {
if (!highlight) return text;
const at = text.indexOf(highlight);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<strong className="cf-ph-em">{highlight}</strong>
{text.slice(at + highlight.length)}
</>
);
}
const CSS = `
.cf-page-header {
--cf-ph-bg: var(--surface, #ffffff);
--cf-ph-ink: var(--ink, #1a2133);
--cf-ph-soft: var(--muted, #4b5565);
--cf-ph-icon: var(--accent, #2f63c8);
--cf-ph-well: color-mix(in oklch, var(--ink, #1a2133) 5%, var(--surface, #ffffff));
--cf-ph-edge: oklch(from var(--ink, #1a2133) l c h / 0.12);
--cf-ph-focus: var(--field-focus, var(--accent, #2f63c8));
--cf-ph-link: var(--link, var(--accent, #2f63c8));
--cf-ph-link-hover: oklch(from var(--link, var(--accent, #2f63c8)) calc(l - 0.08) c h);
--cf-ph-em-ink: var(--accent, #2f63c8);
--cf-ph-gutter: clamp(16px, 5vw, 48px);
--cf-ph-max: 1240px;
--cf-ph-shadow: var(--shadow, oklch(0.22 0.03 256));
position: relative;
z-index: 20;
width: 100%;
background: var(--cf-ph-bg);
color: var(--cf-ph-ink);
font-family: var(--font-body);
box-shadow: inset 0 -1px 0 var(--cf-ph-edge);
}
.cf-page-header[data-tone="band"] {
--cf-ph-bg: var(--band, #1b2a4a);
--cf-ph-ink: var(--band-ink, #ffffff);
--cf-ph-soft: color-mix(in oklch, var(--band-ink, #ffffff) 84%, var(--band, #1b2a4a));
--cf-ph-icon: var(--band-ink, #ffffff);
--cf-ph-well: color-mix(in oklch, var(--band-ink, #ffffff) 9%, var(--band, #1b2a4a));
--cf-ph-edge: oklch(from var(--band-ink, #ffffff) l c h / 0.14);
--cf-ph-focus: var(--band-ink, #ffffff);
--cf-ph-link: var(--band-ink, #ffffff);
--cf-ph-link-hover: var(--band-ink, #ffffff);
--cf-ph-em-ink: var(--band-ink, #ffffff);
}
.cf-page-header[data-sticky="true"] { position: sticky; top: 0; }
.cf-page-header *, .cf-page-header *::before, .cf-page-header *::after { box-sizing: border-box; }
/* The container is the padded content column, so every breakpoint below measures the real room the row has. */
.cf-page-header .cf-ph-cq {
container: cfph / inline-size;
max-width: var(--cf-ph-max);
margin: 0 auto;
padding-inline: var(--cf-ph-gutter);
}
.cf-page-header .cf-ph-inner {
padding-block: 12px;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
grid-template-areas: "brand action" "trust trust";
align-items: center;
column-gap: 12px;
row-gap: 12px;
}
.cf-page-header .cf-ph-inner[data-cta="false"] {
grid-template-columns: minmax(0, 1fr);
grid-template-areas: "brand" "trust";
}
.cf-page-header .cf-ph-inner > * { animation: cf-ph-in .45s cubic-bezier(.2,.7,.2,1) both; }
.cf-page-header .cf-ph-inner > *:nth-child(2) { animation-delay: .07s; }
.cf-page-header .cf-ph-inner > *:nth-child(3) { animation-delay: .14s; }
@keyframes cf-ph-in { from { opacity: .82; transform: translateY(8px); } }
/* Wordmark */
.cf-page-header .cf-ph-brand { grid-area: brand; min-width: 0; display: flex; align-items: center; }
.cf-page-header .cf-ph-brand-link {
display: inline-flex; align-items: center; color: inherit; text-decoration: none;
border-radius: 8px; outline: none;
}
.cf-page-header .cf-ph-brand-link:focus-visible { box-shadow: 0 0 0 3px oklch(from var(--cf-ph-focus) l c h / .45); }
.cf-page-header .cf-ph-wordmark {
display: block;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.025em);
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.04;
color: var(--cf-ph-ink);
text-wrap: balance;
overflow-wrap: anywhere;
}
.cf-page-header .cf-ph-logo {
display: block; height: 36px; width: auto; max-width: 180px;
object-fit: contain; object-position: left center;
}
/* Trust / contact line: icon sits inline with the words so it never strands */
.cf-page-header .cf-ph-trust {
grid-area: trust;
margin: 0;
padding: 8px 12px;
border-radius: 10px;
background: var(--cf-ph-well);
text-align: center;
font-size: 0.9375rem;
line-height: 1.4;
font-weight: 600;
color: var(--cf-ph-ink);
text-wrap: pretty;
}
.cf-page-header .cf-ph-trust-icon {
display: inline-block;
vertical-align: -0.2em;
margin-inline-end: .4em;
color: var(--cf-ph-icon);
}
/* Linked trust line follows the theme's link colour (band-ink on the band), underlined. */
.cf-page-header .cf-ph-trust-link {
color: var(--cf-ph-link);
text-decoration: underline;
text-decoration-color: oklch(from var(--cf-ph-link) l c h / 0.45);
text-underline-offset: 0.18em;
border-radius: 6px;
outline: none;
transition: color .16s ease, text-decoration-color .16s ease;
}
.cf-page-header .cf-ph-trust-link:hover { color: var(--cf-ph-link-hover); text-decoration-color: var(--cf-ph-link-hover); }
.cf-page-header .cf-ph-trust-link:focus-visible { box-shadow: 0 0 0 3px oklch(from var(--cf-ph-focus) l c h / .45); }
/* The promise phrase is carried by weight. Inside the grey phone well it uses the main ink
(the accent is only guaranteed 4.5:1 on card and surface, not on a tinted well);
on the open desktop row, where it sits on the surface, it takes the text-safe accent. */
.cf-page-header .cf-ph-em {
font-weight: 800;
color: var(--cf-ph-ink);
}
/* Action: one-time price line + Add To Cart */
.cf-page-header .cf-ph-action { grid-area: action; display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.cf-page-header .cf-ph-oneline {
display: none;
margin: 0;
text-align: right;
font-size: 0.9375rem;
line-height: 1.4;
color: var(--cf-ph-soft);
font-weight: 500;
}
.cf-page-header .cf-ph-oneline-top { display: block; white-space: nowrap; color: var(--cf-ph-ink); font-weight: 600; }
.cf-page-header .cf-ph-oneline-top strong {
font-weight: 800;
font-variant-numeric: tabular-nums;
}
.cf-page-header .cf-ph-oneline-note { display: block; white-space: nowrap; }
.cf-page-header .cf-ph-cta {
--cf-ph-b: var(--button-bg, var(--cta, #d6402c));
--cf-ph-b2: var(--button-bg-2, var(--cta-2, #b8331f));
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 48px;
padding: 0 8px 0 16px;
border: 0;
margin: 0;
cursor: pointer;
text-decoration: none;
white-space: nowrap;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.15;
color: var(--button-ink, var(--cta-ink, #ffffff));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--cf-ph-b) calc(l + .04) c h), oklch(from var(--cf-ph-b2) calc(l - .02) c h));
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--cf-ph-b) calc(l + .14) c h / .7),
inset 0 -3px 0 oklch(from var(--cf-ph-b) calc(l - .16) c h),
0 1px 2px oklch(from var(--cf-ph-shadow) l c h / .3),
0 8px 16px -6px oklch(from var(--cf-ph-shadow) l c h / .4));
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
outline: none;
-webkit-tap-highlight-color: transparent;
}
.cf-page-header .cf-ph-cta:hover, .cf-page-header .cf-ph-cta[data-state="hover"] {
background: linear-gradient(oklch(from var(--cf-ph-b) calc(l - .01) c h), oklch(from var(--cf-ph-b2) calc(l - .07) c h));
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--cf-ph-b) calc(l + .1) c h / .7),
inset 0 -3px 0 oklch(from var(--cf-ph-b) calc(l - .2) c h),
0 1px 2px oklch(from var(--cf-ph-shadow) l c h / .34),
0 10px 18px -6px oklch(from var(--cf-ph-shadow) l c h / .48));
transform: translateY(-1px);
}
.cf-page-header .cf-ph-cta:active, .cf-page-header .cf-ph-cta[data-state="active"] {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--cf-ph-b) calc(l - .06) c h), oklch(from var(--cf-ph-b2) calc(l - .06) c h));
box-shadow:
inset 0 2px 3px oklch(from var(--cf-ph-b) calc(l - .22) c h / .6),
inset 0 -2px 0 oklch(from var(--cf-ph-b) calc(l - .16) c h),
0 1px 1px oklch(from var(--cf-ph-shadow) l c h / .3);
}
.cf-page-header .cf-ph-cta:focus-visible {
box-shadow:
0 0 0 2px var(--cf-ph-bg),
0 0 0 5px oklch(from var(--cf-ph-focus) l c h / .6),
inset 0 -3px 0 oklch(from var(--cf-ph-b) calc(l - .16) c h);
}
.cf-page-header .cf-ph-cta:disabled {
cursor: not-allowed;
transform: none;
background: var(--secondary, #e8ebf1);
color: var(--secondary-ink, #1a2133);
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
}
.cf-page-header .cf-ph-cta-icon { flex: 0 0 auto; }
.cf-page-header .cf-ph-cta-label { display: inline-block; }
.cf-page-header .cf-ph-cta-long { display: none; }
.cf-page-header .cf-ph-cta-short { display: inline; }
.cf-page-header .cf-ph-cta-price {
display: inline-flex;
align-items: center;
min-height: 34px;
padding: 0 12px;
border-radius: max(4px, calc(var(--button-radius, var(--radius, 12px)) - 4px));
background: oklch(from var(--cf-ph-b) calc(l - .07) c h);
box-shadow: inset 0 1px 1px oklch(from var(--cf-ph-b) calc(l - .18) c h / .55);
font-variant-numeric: tabular-nums;
letter-spacing: -0.01em;
}
.cf-page-header .cf-ph-cta:disabled .cf-ph-cta-price {
background: color-mix(in oklch, var(--ink, #1a2133) 6%, var(--secondary, #e8ebf1));
box-shadow: none;
}
/* Wider phones and up: full "Add To Cart" label */
@container cfph (min-width: 440px) {
.cf-page-header .cf-ph-cta-long { display: inline; }
.cf-page-header .cf-ph-cta-short { display: none; }
}
/* Desktop masthead: wordmark | trust line | price + cart.
Brand and action size to their content; the trust line takes the room between and wraps (balanced) rather than colliding. */
@container cfph (min-width: 900px) {
.cf-page-header .cf-ph-inner {
padding-block: 14px;
grid-template-columns: auto minmax(0, 1fr) auto;
grid-template-areas: "brand trust action";
column-gap: 24px;
}
.cf-page-header .cf-ph-inner[data-cta="false"] {
grid-template-columns: auto minmax(0, 1fr);
grid-template-areas: "brand trust";
}
.cf-page-header .cf-ph-trust { padding: 0; background: none; border-radius: 0; text-wrap: balance; }
.cf-page-header .cf-ph-em { color: var(--cf-ph-em-ink); }
.cf-page-header .cf-ph-wordmark { text-wrap: nowrap; }
.cf-page-header .cf-ph-cta { min-height: 52px; padding: 0 8px 0 18px; gap: 10px; }
.cf-page-header .cf-ph-cta-price { min-height: 36px; }
}
/* The one-time price line joins only when the full row genuinely fits beside the trust line. */
@container cfph (min-width: 1100px) {
.cf-page-header .cf-ph-oneline { display: block; }
}
/* Scroll-linked lift for the sticky header (no JS) */
@supports (animation-timeline: scroll()) {
.cf-page-header[data-sticky="true"] {
animation: cf-ph-lift linear both;
animation-timeline: scroll(root);
animation-range: 0 96px;
}
}
@keyframes cf-ph-lift {
to {
box-shadow:
inset 0 -1px 0 var(--cf-ph-edge),
0 1px 2px oklch(from var(--cf-ph-shadow) l c h / .2),
0 6px 14px -6px oklch(from var(--cf-ph-shadow) l c h / .3);
}
}
@media (prefers-reduced-motion: reduce) {
.cf-page-header .cf-ph-inner > *, .cf-page-header[data-sticky="true"] { animation: none; }
.cf-page-header .cf-ph-cta, .cf-page-header .cf-ph-trust-link { transition: none; }
.cf-page-header .cf-ph-cta:hover, .cf-page-header .cf-ph-cta[data-state="hover"],
.cf-page-header .cf-ph-cta:active, .cf-page-header .cf-ph-cta[data-state="active"] { transform: none; }
}
`;
pieces/content/page-header/specimen.tsx 28 lines
import React from "react";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
import { PageHeader, type PageHeaderProps } from "../page-header";
export const states = ["default", "hover", "active", "disabled"];
export default function PageHeaderSpecimen({ state = "default" }: { state?: PageHeaderProps["state"] }) {
const s = defaults.sample;
return (
<PageHeader
wordmark={s.name}
logoImage={slot("logo", "")}
homeHref="#top"
trustIcon="shield"
trustText={`Backed by our ${s.guarantee}`}
trustHighlight={s.guarantee}
ctaLabel="Add To Cart"
ctaShortLabel="Add"
ctaPrice={s.price}
priceLead={`${s.price} today.`}
priceTail="That's it."
priceNote={s.note}
href="#order"
state={state}
/>
);
}
| Name | Type | Details |
|---|---|---|
wordmark OptionalPageHeader |
string |
|
logoImage OptionalPageHeader |
string |
|
homeHref OptionalPageHeader |
string |
|
trustText OptionalPageHeader |
string |
|
trustHighlight OptionalPageHeader |
string |
|
trustIcon OptionalPageHeader |
PageHeaderTrustIcon |
|
trustHref OptionalPageHeader |
string |
|
showCta OptionalPageHeader |
boolean |
|
ctaLabel OptionalPageHeader |
string |
|
ctaShortLabel OptionalPageHeader |
string |
|
ctaPrice OptionalPageHeader |
string |
|
ctaAriaLabel OptionalPageHeader |
string |
|
href OptionalPageHeader |
string |
|
onAction OptionalPageHeader |
(event: React.MouseEvent<HTMLElement>) => void |
|
disabled OptionalPageHeader |
boolean |
|
priceLead OptionalPageHeader |
string |
|
priceTail OptionalPageHeader |
string |
|
priceNote OptionalPageHeader |
string |
|
tone OptionalPageHeader |
"light" | "band" |
|
sticky OptionalPageHeader |
boolean |
|
state OptionalPageHeader |
"default" | "hover" | "active" | "disabled" |
|
className OptionalPageHeader |
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-shadow- Secondary button.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
logo- The brand’s logo mark.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB