Sales Nav 2
Sales nav 2: a tall sales header whose links read as stops on a path that ends at the action button.
Use it in a prompt
Use nav/sales-nav-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/nav/sales-nav-2.tsx. - Import it and pass your copy and images (Props tab):
import { SalesNav2 } from "@/components/funneldna/nav/sales-nav-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/nav/sales-nav-2/component.tsx 694 lines
// layout: path-to-action
// Sales nav 2: a tall sales header whose links read as stops on a path that ends at the action button.
// Past ~120px of scroll it morphs into a floating glass pill with a sliding active indicator and a reading-progress rail.
import React from 'react'
import { AnimatePresence, MotionConfig, motion, useMotionValueEvent, useReducedMotion, useScroll } from 'motion/react'
import { Gift, Menu, ShieldCheck, X } from 'lucide-react'
export type SalesNav2Link = {
label: string
href: string
/** One benefit line under the label in the phone menu. */
detail?: string
}
export type SalesNav2TextLink = {
label: string
href: string
}
export type SalesNav2Offer = {
/** Itemised value lines for the menu ledger. */
items: { name: string; value: string }[]
totalLabel?: string
/** Regular value the lines add up to. */
total?: string
todayLabel?: string
/** Today's price, set large. */
price: string
note?: string
}
export type SalesNav2Copy = {
navLabel?: string
menuNavLabel?: string
openMenu?: string
closeMenu?: string
menuTitle?: string
/** Accessible name of the logo link; {brand} is replaced with brandName. */
homeLabel?: string
totalLabel?: string
todayLabel?: string
}
export type SalesNav2Props = {
brandName?: string
/** Logo slot image. When empty, the wordmark shows. */
logoImage?: string
logoAlt?: string
homeHref?: string
/** One supplied offer line for the strip above the header. Hidden when empty. */
announcement?: React.ReactNode
announcementLink?: SalesNav2TextLink
/** Three to five short section anchors. An empty list gives the logo + CTA bar. */
links?: SalesNav2Link[]
/** Quiet text link beside the button. */
secondaryLink?: SalesNav2TextLink
/** Set false for the no-CTA variant. */
showAction?: boolean
label?: string
/** Benefit line inside the button, under the action (tall header and menu). */
sublabel?: string
/** Shorter action label used on phones. */
compactLabel?: string
href?: string
onAction?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void
/** One reassurance line under the menu button, e.g. the guarantee. */
reassurance?: string
/** Value ledger shown in the phone menu above the action. */
offer?: SalesNav2Offer
/** Sticks to the top and morphs on scroll. */
sticky?: boolean
/** Forces the pill (true) or the tall header (false). Unset follows scroll (or the scrolled state). */
morphed?: boolean
/** Fixes the reading-progress rail (0 to 1) instead of tracking scroll, e.g. for previews. */
progress?: number
/** Marks the current link. When unset, the section in view is tracked. */
activeHref?: string
disabled?: boolean
/** 'scrolled' shows the morphed pill without scrolling. */
state?: 'default' | 'scrolled' | 'hover' | 'active' | 'disabled'
copy?: SalesNav2Copy
className?: string
}
const DEFAULT_LINKS: SalesNav2Link[] = [
{ label: 'How it works', href: '#how-it-works' },
{ label: 'What’s inside', href: '#inside' },
{ label: 'Who it’s for', href: '#who' },
{ label: 'Guarantee', href: '#guarantee' },
]
const DEFAULT_COPY: Required<SalesNav2Copy> = {
navLabel: 'Main',
menuNavLabel: 'Page sections',
openMenu: 'Open menu',
closeMenu: 'Close menu',
menuTitle: 'Menu',
homeLabel: '{brand} home',
totalLabel: 'Total value',
todayLabel: 'Yours today for',
}
const SPRING = { type: 'spring' as const, stiffness: 420, damping: 40, mass: 0.9 }
const EASE: [number, number, number, number] = [0.2, 0.7, 0.2, 1]
const FOCUSABLE = 'a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])'
const useIsoLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect
export function SalesNav2({
brandName = 'Funnel Starter',
logoImage,
logoAlt,
homeHref = '#',
announcement,
announcementLink,
links = DEFAULT_LINKS,
secondaryLink,
showAction = true,
label = 'Get the Starter Kit',
sublabel = 'Instant download',
compactLabel = 'Get the kit',
href,
onAction,
reassurance,
offer,
sticky = true,
morphed: forceMorphed,
progress,
activeHref,
disabled: disabledProp = false,
state = 'default',
copy: copyProp,
className,
}: SalesNav2Props) {
const copy = { ...DEFAULT_COPY, ...copyProp }
const items = links.slice(0, 5)
const hasLinks = items.length > 0
const hasAction = showAction && Boolean(label)
const disabled = disabledProp || state === 'disabled'
const forced = state === 'hover' || state === 'active' ? state : undefined
const reduce = useReducedMotion()
const uid = React.useId().replace(/:/g, '')
const sheetId = 'cf-sn2-sheet-' + uid
const titleId = 'cf-sn2-title-' + uid
const hrefKey = items.map((link) => link.href).join('|')
const homeLabel = copy.homeLabel.replace('{brand}', brandName)
const [past, setPast] = React.useState(false)
const [open, setOpen] = React.useState(false)
const [spy, setSpy] = React.useState<string | undefined>(undefined)
const [pillRadius, setPillRadius] = React.useState(28)
const shellRef = React.useRef<HTMLDivElement>(null)
const probeRef = React.useRef<HTMLSpanElement>(null)
const reservedRef = React.useRef(0)
const menuRef = React.useRef<HTMLButtonElement>(null)
const closeRef = React.useRef<HTMLButtonElement>(null)
const sheetRef = React.useRef<HTMLDivElement>(null)
const morphed = forceMorphed ?? (state === 'scrolled' || (sticky && past))
const floating = sticky && morphed && reservedRef.current > 0
const current = activeHref ?? spy
const sheetOpen = open && hasLinks
const currentIndex = items.findIndex((link) => link.href === current)
const { scrollY, scrollYProgress } = useScroll()
const railProgress = typeof progress === 'number' && Number.isFinite(progress) ? Math.min(1, Math.max(0, progress)) : undefined
useMotionValueEvent(scrollY, 'change', (y) => {
if (sticky) setPast((was) => (was ? y > 72 : y > 120))
})
React.useEffect(() => {
if (sticky) setPast(window.scrollY > 120)
}, [sticky])
// Read the themed pill radius so motion can correct it during the layout morph.
useIsoLayoutEffect(() => {
const probe = probeRef.current
if (probe) {
const r = parseFloat(window.getComputedStyle(probe).borderTopLeftRadius)
if (Number.isFinite(r) && r !== pillRadius) setPillRadius(r)
}
if (!morphed && shellRef.current) reservedRef.current = shellRef.current.offsetHeight
})
React.useEffect(() => {
const shell = shellRef.current
if (morphed || !shell || typeof ResizeObserver === 'undefined') return
const observer = new ResizeObserver(() => {
reservedRef.current = shell.offsetHeight
})
observer.observe(shell)
return () => observer.disconnect()
}, [morphed])
React.useEffect(() => {
if (activeHref !== undefined || typeof IntersectionObserver === 'undefined') return
const hrefs = hrefKey ? hrefKey.split('|') : []
const targets: HTMLElement[] = []
hrefs.forEach((target) => {
if (!target.startsWith('#') || target.length < 2) return
const el = document.getElementById(decodeURIComponent(target.slice(1)))
if (el) targets.push(el)
})
if (!targets.length) return
const visible = new Set<string>()
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
const id = '#' + entry.target.id
if (entry.isIntersecting) visible.add(id)
else visible.delete(id)
})
setSpy(hrefs.find((target) => visible.has(target)))
},
{ rootMargin: '-45% 0px -50% 0px' },
)
targets.forEach((target) => observer.observe(target))
return () => observer.disconnect()
}, [activeHref, hrefKey])
const closeMenu = React.useCallback((restoreFocus: boolean) => {
setOpen(false)
if (restoreFocus) window.requestAnimationFrame(() => menuRef.current?.focus())
}, [])
React.useEffect(() => {
if (!sheetOpen) return
const body = document.body
const previous = body.style.overflow
body.style.overflow = 'hidden'
const frame = window.requestAnimationFrame(() => closeRef.current?.focus())
const onKey = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
event.preventDefault()
closeMenu(true)
return
}
const sheet = sheetRef.current
if (event.key !== 'Tab' || !sheet) return
const nodes = Array.from(sheet.querySelectorAll<HTMLElement>(FOCUSABLE))
if (!nodes.length) return
const first = nodes[0]
const last = nodes[nodes.length - 1]
const active = document.activeElement
const inside = active instanceof Node && sheet.contains(active)
if (event.shiftKey && (active === first || !inside)) {
event.preventDefault()
last.focus()
} else if (!event.shiftKey && (active === last || !inside)) {
event.preventDefault()
first.focus()
}
}
const wide = window.matchMedia('(min-width: 1180px)')
const onWide = () => {
if (wide.matches) setOpen(false)
}
document.addEventListener('keydown', onKey)
wide.addEventListener('change', onWide)
return () => {
window.cancelAnimationFrame(frame)
body.style.overflow = previous
document.removeEventListener('keydown', onKey)
wide.removeEventListener('change', onWide)
}
}, [sheetOpen, closeMenu])
const pick = (target: string) => {
if (activeHref === undefined) setSpy(target)
}
const rootClass = ['cf-sales-nav-2', className].filter(Boolean).join(' ')
const sheetMotion = reduce ? { duration: 0 } : { duration: 0.32, ease: EASE }
return (
<MotionConfig reducedMotion="user" transition={reduce ? { duration: 0 } : SPRING}>
<motion.header
layoutRoot
className={rootClass}
data-morphed={morphed ? 'true' : 'false'}
data-floating={floating ? 'true' : 'false'}
data-sticky={sticky ? 'true' : 'false'}
data-links={hasLinks ? 'true' : 'false'}
style={floating ? { height: reservedRef.current } : undefined}
>
<style>{CSS}</style>
<span ref={probeRef} className="cf-sn2-probe" aria-hidden="true" />
<div ref={shellRef} className="cf-sn2-shell">
{announcement && !morphed ? (
<p className="cf-sn2-strip">
<Gift className="cf-sn2-strip-icon" strokeWidth={2.5} aria-hidden="true" />
{announcement}
{announcementLink ? <a href={announcementLink.href}>{announcementLink.label}</a> : null}
</p>
) : null}
<motion.div layout className="cf-sn2-bar" style={{ borderRadius: morphed ? pillRadius : 0 }}>
<div className="cf-sn2-row">
<motion.a layout="position" className="cf-sn2-logo" href={homeHref} aria-label={homeLabel}>
<Brand name={brandName} image={logoImage} alt={logoAlt} />
</motion.a>
{hasLinks ? (
<motion.nav layout="position" className="cf-sn2-links" aria-label={copy.navLabel}>
<span className="cf-sn2-route" aria-hidden="true" />
<ul>
{items.map((link, index) => {
const isCurrent = current === link.href
const passed = currentIndex > -1 && index < currentIndex
return (
<li key={link.href}>
<a
className="cf-sn2-link"
href={link.href}
data-passed={passed ? 'true' : undefined}
aria-current={isCurrent ? 'location' : undefined}
onClick={() => pick(link.href)}
>
{link.label}
<span className="cf-sn2-node" aria-hidden="true" />
{isCurrent ? (
<motion.span layoutId={'cf-sn2-ind-' + uid} className="cf-sn2-ind" aria-hidden="true" />
) : null}
</a>
</li>
)
})}
</ul>
</motion.nav>
) : null}
<motion.div layout="position" className="cf-sn2-actions">
{secondaryLink ? (
<a className="cf-sn2-sec" href={secondaryLink.href}>
{secondaryLink.label}
</a>
) : null}
{hasAction ? (
<Action
label={label}
short={compactLabel}
sub={sublabel}
href={href}
onClick={onAction}
disabled={disabled}
forced={forced}
/>
) : null}
{hasLinks ? (
<button
ref={menuRef}
type="button"
className="cf-sn2-icon-btn cf-sn2-menu"
aria-label={copy.openMenu}
aria-haspopup="dialog"
aria-expanded={sheetOpen}
aria-controls={sheetOpen ? sheetId : undefined}
onClick={() => setOpen(true)}
>
<Menu strokeWidth={2.5} aria-hidden="true" />
</button>
) : null}
</motion.div>
</div>
<AnimatePresence initial={false}>
{morphed ? (
<motion.span
key="rail"
className="cf-sn2-rail"
aria-hidden="true"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
>
<motion.span className="cf-sn2-rail-fill" style={{ scaleX: railProgress ?? scrollYProgress }} />
</motion.span>
) : null}
</AnimatePresence>
</motion.div>
</div>
<AnimatePresence>
{sheetOpen ? (
<motion.div
key="sheet"
className="cf-sn2-layer"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={sheetMotion}
>
<div className="cf-sn2-scrim" aria-hidden="true" onClick={() => closeMenu(true)} />
<motion.div
ref={sheetRef}
id={sheetId}
role="dialog"
aria-modal="true"
aria-labelledby={titleId}
className="cf-sn2-sheet"
initial={{ x: '100%' }}
animate={{ x: 0 }}
exit={{ x: '100%' }}
transition={sheetMotion}
>
<div className="cf-sn2-sheet-head">
<h2 id={titleId} className="cf-sn2-sr">
{copy.menuTitle}
</h2>
<span className="cf-sn2-sheet-brand">
<Brand name={brandName} image={logoImage} alt={logoAlt} />
</span>
<button
ref={closeRef}
type="button"
className="cf-sn2-icon-btn"
aria-label={copy.closeMenu}
onClick={() => closeMenu(true)}
>
<X strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
<div className="cf-sn2-sheet-body">
<nav aria-label={copy.menuNavLabel}>
<ol className="cf-sn2-stops">
{items.map((link, index) => {
const isCurrent = current === link.href
return (
<li key={link.href}>
<a
className="cf-sn2-stop"
href={link.href}
aria-current={isCurrent ? 'location' : undefined}
onClick={() => {
pick(link.href)
closeMenu(false)
}}
>
<span className="cf-sn2-stop-num" aria-hidden="true">
{String(index + 1).padStart(2, '0')}
</span>
<span className="cf-sn2-stop-label">{link.label}</span>
{link.detail ? <span className="cf-sn2-stop-detail">{link.detail}</span> : null}
</a>
</li>
)
})}
</ol>
{secondaryLink ? (
<a className="cf-sn2-sec cf-sn2-sheet-sec" href={secondaryLink.href} onClick={() => closeMenu(false)}>
{secondaryLink.label}
</a>
) : null}
</nav>
{offer && offer.items.length ? (
<Ledger offer={offer} totalLabel={copy.totalLabel} todayLabel={copy.todayLabel} />
) : null}
</div>
{hasAction ? (
<div className="cf-sn2-sheet-foot">
<Action
block
label={label}
sub={sublabel}
href={href}
disabled={disabled}
forced={forced}
onClick={(event) => {
onAction?.(event)
closeMenu(false)
}}
/>
{reassurance ? (
<p className="cf-sn2-reassure">
<ShieldCheck strokeWidth={2.5} aria-hidden="true" />
{reassurance}
</p>
) : null}
</div>
) : null}
</motion.div>
</motion.div>
) : null}
</AnimatePresence>
</motion.header>
</MotionConfig>
)
}
export default SalesNav2
function Brand({ name, image, alt }: { name: string; image?: string; alt?: string }) {
if (image) return <img src={image} alt={alt ?? name} />
return <span className="cf-sn2-word">{name}</span>
}
type ActionProps = {
label: string
short?: string
sub?: string
href?: string
onClick?: (event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void
disabled: boolean
forced?: 'hover' | 'active'
block?: boolean
}
function Action({ label, short, sub, href, onClick, disabled, forced, block }: ActionProps) {
const hasShort = Boolean(short && short !== label)
const className = ['cf-sn2-cta', block ? 'is-block' : '', hasShort ? 'has-short' : '', forced ? 'is-' + forced : '']
.filter(Boolean)
.join(' ')
const content = (
<>
<span className="cf-sn2-cta-main">
<span className="cf-sn2-cta-full">{label}</span>
{hasShort ? <span className="cf-sn2-cta-short">{short}</span> : null}
</span>
{sub ? <span className="cf-sn2-cta-sub">{sub}</span> : null}
</>
)
if (href && !disabled) {
return (
<a className={className} href={href} onClick={onClick}>
{content}
</a>
)
}
return (
<button type="button" className={className} disabled={disabled} onClick={disabled ? undefined : onClick}>
{content}
</button>
)
}
function Ledger({ offer, totalLabel, todayLabel }: { offer: SalesNav2Offer; totalLabel: string; todayLabel: string }) {
return (
<div className="cf-sn2-ledger">
<ul className="cf-sn2-ledger-list">
{offer.items.map((item) => (
<li key={item.name} className="cf-sn2-ledger-row">
<span className="cf-sn2-ledger-name">{item.name}</span>
<span className="cf-sn2-leader" aria-hidden="true" />
<span className="cf-sn2-ledger-val">{item.value}</span>
</li>
))}
</ul>
{offer.total ? (
<p className="cf-sn2-ledger-row cf-sn2-ledger-total">
<span className="cf-sn2-ledger-name">{offer.totalLabel ?? totalLabel}</span>
<span className="cf-sn2-leader" aria-hidden="true" />
<span className="cf-sn2-ledger-val">{offer.total}</span>
</p>
) : null}
<p className="cf-sn2-today">
<span className="cf-sn2-today-label">{offer.todayLabel ?? todayLabel}</span>
<span className="cf-sn2-today-price">{offer.price}</span>
</p>
{offer.note ? <p className="cf-sn2-today-note">{offer.note}</p> : null}
</div>
)
}
const CSS = `
.cf-sales-nav-2{--sn2-gutter:clamp(16px,5vw,48px);--sn2-pill:calc(var(--radius,12px) * 2 + 4px);--sn2-line:oklch(from var(--ink) l c h / .12);position:sticky;top:0;z-index:40;pointer-events:none;font-family:var(--font-body);color:var(--ink)}
.cf-sales-nav-2[data-sticky='false']{position:relative}
.cf-sales-nav-2 *,.cf-sales-nav-2 *::before,.cf-sales-nav-2 *::after{box-sizing:border-box}
.cf-sn2-probe{position:absolute;top:0;left:0;width:0;height:0;overflow:hidden;visibility:hidden;border-radius:var(--sn2-pill)}
.cf-sn2-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-sn2-shell{position:relative;top:0;left:0;right:0}
.cf-sales-nav-2[data-floating='true'] .cf-sn2-shell{position:absolute}
.cf-sn2-strip{pointer-events:auto;margin:0;padding:10px var(--sn2-gutter);background:var(--band);color:var(--band-ink);text-align:center;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-sn2-strip strong{font-weight:800}
.cf-sn2-strip-icon{display:inline-block;width:18px;height:18px;vertical-align:-.22em;margin-inline-end:.45em}
.cf-sn2-strip a{margin-inline-start:.6em;border-radius:4px;color:var(--band-ink);font-weight:800;white-space:nowrap;text-decoration:underline;text-decoration-thickness:1.5px;text-decoration-color:oklch(from var(--band-ink) l c h / .55);text-underline-offset:.2em}
.cf-sn2-strip a:hover{text-decoration-color:var(--band-ink)}
.cf-sn2-strip a:focus-visible{outline:3px solid var(--band-ink);outline-offset:2px}
.cf-sn2-bar{pointer-events:auto;position:relative;width:100%;margin:0 auto;padding:14px var(--sn2-gutter);background:var(--card);color:var(--ink);border:0 solid var(--sn2-line);border-bottom-width:1px}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-bar{width:calc(100% - 2 * var(--sn2-gutter));max-width:1160px;margin-top:12px;padding:8px 8px 8px 20px;border-width:1px;box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + .04) c h / .6),var(--shadow-md,0 1px 2px oklch(.22 .03 260 / .22),0 4px 10px -2px oklch(.22 .03 260 / .2))}
@supports ((backdrop-filter:blur(2px)) or (-webkit-backdrop-filter:blur(2px))){.cf-sales-nav-2[data-morphed='true'] .cf-sn2-bar{background:oklch(from var(--card) l c h / .86);-webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4)}}
.cf-sn2-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:'logo nav actions';align-items:center;column-gap:24px;max-width:1120px;min-height:64px;margin:0 auto}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-row{max-width:none;min-height:48px;column-gap:16px}
.cf-sn2-logo{grid-area:logo;justify-self:start;display:inline-flex;align-items:center;min-width:0;padding:4px 2px;border-radius:8px;color:var(--ink);text-decoration:none}
.cf-sn2-logo img,.cf-sn2-sheet-brand img{display:block;width:auto;height:40px;max-width:200px;object-fit:contain}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-logo img{height:30px;max-width:160px}
.cf-sn2-word{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;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.3125rem,1.8vw,1.625rem);line-height:1.15}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-word{font-size:1.3125rem}
.cf-sn2-logo:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.cf-sn2-links{grid-area:nav;justify-self:center;position:relative}
.cf-sn2-links ul{position:relative;display:flex;align-items:center;gap:4px;margin:0;padding:0;list-style:none}
.cf-sn2-route{position:absolute;left:14px;right:14px;bottom:3px;height:1px;background:oklch(from var(--ink) l c h / .16);pointer-events:none}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-route{display:none}
.cf-sn2-node{position:absolute;left:50%;bottom:0;width:8px;height:8px;margin-left:-4px;border-radius:50%;background:var(--card);box-shadow:inset 0 0 0 2px oklch(from var(--ink) l c h / .3);pointer-events:none;transition:background-color .16s ease,box-shadow .16s ease}
.cf-sn2-link[data-passed='true'] .cf-sn2-node{background:var(--accent-fill,var(--accent));box-shadow:none}
.cf-sn2-link[aria-current] .cf-sn2-node,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-node{display:none}
.cf-sn2-link{position:relative;display:inline-flex;align-items:center;min-height:44px;padding:10px 14px;border-radius:max(calc(var(--radius,12px) - 2px),0px);color:var(--ink);font-size:1.0625rem;font-weight:600;line-height:1.2;white-space:nowrap;text-decoration:none;transition:background-color .16s ease,transform .16s ease}
.cf-sn2-link:hover{background:color-mix(in oklch,var(--ink) 6%,var(--card))}
.cf-sn2-link:active{transform:translateY(1px);background:color-mix(in oklch,var(--ink) 10%,var(--card))}
.cf-sn2-link:focus-visible{outline:3px solid var(--accent);outline-offset:1px}
.cf-sn2-ind{position:absolute;left:14px;right:14px;bottom:2px;height:3px;border-radius:3px;background:var(--accent-fill,var(--accent));pointer-events:none}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-link{padding:10px 12px;font-size:.9375rem}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-ind{left:12px;right:12px;bottom:4px}
.cf-sn2-actions{grid-area:actions;justify-self:end;display:flex;align-items:center;gap:20px}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-actions{gap:16px}
.cf-sn2-sec{padding:6px 2px;border-radius:4px;color:var(--link,var(--accent));font-size:1rem;font-weight:700;line-height:1.2;white-space:nowrap;text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / .45);text-underline-offset:.18em;transition:color .16s ease}
.cf-sn2-sec:hover{color:oklch(from var(--link,var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-sn2-sec:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.cf-sn2-cta{--sn2-bg:var(--button-bg,var(--cta));--sn2-bg-2:var(--button-bg-2,var(--cta-2));--sn2-shade:var(--shadow,oklch(.22 .03 260));position:relative;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:58px;margin:0;padding:8px 26px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--sn2-bg) calc(l + .04) c h),oklch(from var(--sn2-bg-2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow,none);white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--sn2-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--sn2-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--sn2-shade) l c h / .3),0 8px 16px -6px oklch(from var(--sn2-shade) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-sn2-cta-main{font-size:1.125rem;line-height:1.15}
.cf-sn2-cta-short{display:none}
.cf-sn2-cta-sub{font-family:var(--font-body);font-size:.875rem;font-weight:600;line-height:1.2;letter-spacing:0;text-transform:none}
.cf-sn2-cta:not([disabled]):hover,.cf-sn2-cta.is-hover:not([disabled]){transform:translateY(-1px);background:linear-gradient(oklch(from var(--sn2-bg) calc(l - .01) c h),oklch(from var(--sn2-bg-2) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--sn2-bg) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--sn2-bg) calc(l - .2) c h),0 1px 2px oklch(from var(--sn2-shade) l c h / .35),0 10px 18px -6px oklch(from var(--sn2-shade) l c h / .55))}
.cf-sn2-cta:not([disabled]):active,.cf-sn2-cta.is-active:not([disabled]){transform:translateY(1px);background:linear-gradient(oklch(from var(--sn2-bg) calc(l - .03) c h),oklch(from var(--sn2-bg-2) calc(l - .08) c h));box-shadow:inset 0 2px 3px oklch(from var(--sn2-bg) calc(l - .2) c h / .45),inset 0 -2px 0 oklch(from var(--sn2-bg) calc(l - .16) c h),0 1px 1px oklch(from var(--sn2-shade) l c h / .3)}
.cf-sn2-cta:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.cf-sn2-cta[disabled]{cursor:not-allowed;background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:inset 0 -2px 0 oklch(from var(--secondary) calc(l - .1) c h)}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-bar .cf-sn2-cta{min-height:48px;padding:6px 22px;border-radius:var(--button-radius,max(calc(var(--sn2-pill) - 8px),0px))}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-bar .cf-sn2-cta-sub{display:none}
.cf-sn2-cta.is-block{display:flex;width:100%;min-height:64px;padding:10px 24px;white-space:normal}
.cf-sn2-cta.is-block .cf-sn2-cta-main{font-size:clamp(1.125rem,1.55vw,1.375rem);text-wrap:balance}
.cf-sn2-icon-btn{--sn2-b2:var(--button-2-bg,var(--secondary));display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;margin:0;padding:0;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--sn2-b2);color:var(--button-2-ink,var(--secondary-ink));cursor:pointer;-webkit-tap-highlight-color:transparent;box-shadow:var(--button-2-shadow,inset 0 -2px 0 oklch(from var(--sn2-b2) calc(l - .1) c h),var(--shadow-sm,0 1px 2px oklch(.22 .03 260 / .2)));transition:background-color .16s ease,transform .16s ease}
.cf-sn2-icon-btn:hover{background:oklch(from var(--sn2-b2) calc(l - .04) c h)}
.cf-sn2-icon-btn:active{transform:translateY(1px)}
.cf-sn2-icon-btn:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.cf-sn2-icon-btn svg{width:20px;height:20px}
.cf-sn2-menu{display:none}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-menu{border-radius:var(--button-radius,max(calc(var(--sn2-pill) - 8px),0px))}
.cf-sn2-rail{position:absolute;left:max(var(--sn2-pill),16px);right:max(var(--sn2-pill),16px);bottom:0;height:3px;overflow:hidden;border-radius:3px 3px 0 0;background:oklch(from var(--ink) l c h / .1);pointer-events:none}
.cf-sn2-rail-fill{position:absolute;inset:0;background:var(--accent-fill,var(--accent));transform-origin:0 50%}
.cf-sn2-layer{position:fixed;inset:0;z-index:60;display:flex;justify-content:flex-end;pointer-events:auto}
.cf-sn2-scrim{position:absolute;inset:0;background:oklch(from var(--band) l c h / .6);cursor:pointer}
.cf-sn2-sheet{position:relative;display:flex;flex-direction:column;width:min(100%,440px);height:100%;max-height:100dvh;background:var(--card);color:var(--ink);box-shadow:var(--shadow-lg,0 2px 4px oklch(.22 .03 260 / .22),0 12px 24px -8px oklch(.22 .03 260 / .32))}
.cf-sn2-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:72px;padding:12px var(--sn2-gutter);border-bottom:1px solid var(--sn2-line)}
.cf-sn2-sheet-brand{min-width:0}
.cf-sn2-sheet-brand .cf-sn2-word{font-size:1.3125rem}
.cf-sn2-sheet-brand img{height:32px;max-width:160px}
.cf-sn2-sheet-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px max(calc(var(--sn2-gutter) - 8px),8px) 24px}
.cf-sn2-stops{display:grid;gap:4px;margin:0;padding:0;list-style:none}
.cf-sn2-stop{display:grid;grid-template-columns:2.4ch minmax(0,1fr);column-gap:14px;align-items:baseline;min-height:60px;padding:14px;border-radius:var(--radius,12px);color:var(--ink);text-decoration:none;transition:background-color .16s ease,transform .16s ease}
.cf-sn2-stop-num{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--accent);font-variant-numeric:tabular-nums}
.cf-sn2-stop-label{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance}
.cf-sn2-stop-detail{grid-column:2;margin-top:4px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-sn2-stop:hover{background:color-mix(in oklch,var(--ink) 5%,var(--card))}
.cf-sn2-stop:active{transform:translateY(1px)}
.cf-sn2-stop:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
.cf-sn2-stop[aria-current]{background:color-mix(in oklch,var(--accent) 10%,var(--card))}
.cf-sn2-sheet-sec{display:inline-block;margin:16px 14px 0;font-size:1.0625rem}
.cf-sn2-ledger{margin:20px 0 0;padding:16px 18px 18px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-sn2-ledger-list{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.cf-sn2-ledger-row{display:flex;align-items:baseline;gap:10px;margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--ink)}
.cf-sn2-ledger-name{min-width:0;text-wrap:pretty}
.cf-sn2-leader{flex:1 1 16px;min-width:16px;align-self:flex-end;height:1px;margin-bottom:.45em;background:oklch(from var(--ink) l c h / .2)}
.cf-sn2-ledger-val{flex:none;font-weight:700;font-variant-numeric:tabular-nums}
.cf-sn2-ledger-total{margin-top:12px;font-size:1.0625rem;font-weight:800}
.cf-sn2-ledger-total .cf-sn2-ledger-val{font-weight:800;text-decoration:line-through;text-decoration-color:var(--danger);text-decoration-thickness:2px}
.cf-sn2-today{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:16px 0 0}
.cf-sn2-today-label{font-size:.9375rem;font-weight:700;line-height:1.3;text-wrap:balance}
.cf-sn2-today-price{flex:none;font-family:var(--font-display);font-weight:800;font-size:2.5rem;line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-sn2-today-note{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-sn2-sheet-foot{flex:none;padding:16px var(--sn2-gutter) calc(16px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--sn2-line);background:var(--card)}
.cf-sn2-reassure{margin:12px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
.cf-sn2-reassure svg{display:inline-block;width:16px;height:16px;vertical-align:-.15em;margin-inline-end:.4em;color:var(--success)}
@media (max-width:1179.98px){
.cf-sales-nav-2[data-links='true'] .cf-sn2-links,.cf-sales-nav-2[data-links='true'] .cf-sn2-bar .cf-sn2-sec{display:none}
.cf-sales-nav-2[data-links='true'] .cf-sn2-menu{display:inline-flex}
.cf-sales-nav-2[data-links='true'] .cf-sn2-row{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'logo actions'}
.cf-sn2-actions,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-actions{gap:10px}
}
@media (max-width:599.98px){
.cf-sn2-strip{padding:9px var(--sn2-gutter)}
.cf-sn2-bar{padding:12px var(--sn2-gutter)}
.cf-sales-nav-2[data-morphed='true'] .cf-sn2-bar{margin-top:10px;padding:8px 8px 8px 16px}
.cf-sn2-row,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-row{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'logo actions';min-height:48px;column-gap:10px}
.cf-sn2-links,.cf-sn2-bar .cf-sn2-sec{display:none}
.cf-sn2-word,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-word{font-size:1.125rem}
.cf-sn2-logo img,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-logo img{height:30px;max-width:136px}
.cf-sn2-actions,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-actions{gap:8px}
.cf-sales-nav-2 .cf-sn2-bar .cf-sn2-cta,.cf-sales-nav-2[data-morphed='true'] .cf-sn2-bar .cf-sn2-cta{min-height:44px;padding:6px 14px}
.cf-sn2-logo{max-width:100%}
.cf-sn2-bar .cf-sn2-cta-sub{display:none}
.cf-sn2-bar .cf-sn2-cta.has-short .cf-sn2-cta-full{display:none}
.cf-sn2-bar .cf-sn2-cta.has-short .cf-sn2-cta-short{display:inline}
}
@media (prefers-reduced-motion:reduce){
.cf-sn2-link,.cf-sn2-sec,.cf-sn2-cta,.cf-sn2-icon-btn,.cf-sn2-stop,.cf-sn2-node{transition:none}
.cf-sn2-cta:not([disabled]):hover,.cf-sn2-cta.is-hover:not([disabled]){transform:none}
}
`
pieces/nav/sales-nav-2/specimen.tsx 51 lines
import React from 'react'
import { SalesNav2 } from '../sales-nav-2'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
const sample = defaults.sample
export const states = ['default', 'scrolled', 'hover', 'active', 'disabled']
type SpecimenState = 'default' | 'scrolled' | 'hover' | 'active' | 'disabled'
export default function SalesNav2Specimen({ state = 'default' }: { state?: SpecimenState }) {
const [guide, workbook, checklist] = sample.items
const logo = slot('logo', '')
const scrolled = state === 'scrolled'
return (
<SalesNav2
brandName="Funnel Starter"
logoImage={logo || undefined}
announcement={
<>
Guide, workbook and checklist for <strong>{sample.price}</strong>. {sample.note}.
</>
}
announcementLink={{ label: 'See the kit', href: '#kit' }}
links={[
{ label: 'Plan it', href: '#plan', detail: guide.detail },
{ label: 'Write it', href: '#write', detail: workbook.detail },
{ label: 'Launch it', href: '#launch', detail: checklist.detail },
{ label: 'Your kit', href: '#kit', detail: 'Guide, workbook and checklist in one download.' },
]}
secondaryLink={{ label: 'Free workshop', href: '#workshop' }}
label="Get the Starter Kit"
sublabel={'Instant download · ' + sample.price}
compactLabel="Get the kit"
href="#kit"
reassurance={sample.guarantee}
offer={{
items: sample.items.map((item) => ({ name: item.name, value: item.value })),
total: sample.regularPrice,
todayLabel: sample.todayLabel,
price: sample.price,
note: sample.note,
}}
activeHref={scrolled ? '#write' : undefined}
progress={scrolled ? 0.42 : undefined}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
brandName OptionalSalesNav2 |
string |
Default 'Funnel Starter'
|
logoImage OptionalSalesNav2 |
string |
|
logoAlt OptionalSalesNav2 |
string |
|
homeHref OptionalSalesNav2 |
string |
Default '#'
|
announcement OptionalSalesNav2 |
React.ReactNode |
|
announcementLink OptionalSalesNav2 |
SalesNav2TextLink |
|
links OptionalSalesNav2 |
SalesNav2Link[] |
Default DEFAULT_LINKS
|
secondaryLink OptionalSalesNav2 |
SalesNav2TextLink |
|
showAction OptionalSalesNav2 |
boolean |
Default true
|
label OptionalSalesNav2 |
string |
Default 'Get the Starter Kit'
|
sublabel OptionalSalesNav2 |
string |
Default 'Instant download'
|
compactLabel OptionalSalesNav2 |
string |
Default 'Get the kit'
|
href OptionalSalesNav2 |
string |
|
onAction OptionalSalesNav2 |
(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void |
|
reassurance OptionalSalesNav2 |
string |
|
offer OptionalSalesNav2 |
SalesNav2Offer |
|
sticky OptionalSalesNav2 |
boolean |
Default true
|
morphed OptionalSalesNav2 |
boolean |
|
progress OptionalSalesNav2 |
number |
|
activeHref OptionalSalesNav2 |
string |
|
disabled OptionalSalesNav2 |
boolean |
Default false
|
state OptionalSalesNav2 |
'default' | 'scrolled' | 'hover' | 'active' | 'disabled' |
Default 'default'
|
copy OptionalSalesNav2 |
SalesNav2Copy |
|
className OptionalSalesNav2 |
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.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
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