Free Book Hero 4
Free + shipping book hero: the book lies open on a desk and bleeds off the left edge, the claim card breaks the photo's frame, and choosing a country prices the shipping live from the supplied rates before step one is sent.
Use it in a prompt
Use hero/free-book-hero-4 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/hero/free-book-hero-4.tsx. - Import it and pass your copy and images (Props tab):
import { FreeBookHero4 } from "@/components/funneldna/hero/free-book-hero-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/free-book-hero-4/component.tsx 592 lines
// layout: photo-overlap-card
// Free + shipping book hero: the book lies open on a desk and bleeds off the left edge, the claim card breaks the photo's frame, and choosing a country prices the shipping live from the supplied rates before step one is sent.
'use client'
import * as React from 'react'
import { AlertCircle, ChevronDown, Loader2, Lock, PackageX, Truck } from 'lucide-react'
export type FreeBookHero4Chapter = {
title: string
/** One fascination line under the title. Hidden on phones so the list stays compact. */
teaser?: string
/** Rail numeral. Defaults to 01, 02, 03 and so on. */
number?: string
}
export type FreeBookHero4Region = {
/** Option value. ISO country codes let browser autofill pick the right region. */
code: string
label: string
/** Supplied shipping rate, e.g. '$7.95'. Without one, the region says plainly that it can’t ship there and the button is disabled. */
rate?: string
/** How the region reads in a sentence, e.g. 'the United States'. Defaults to label. */
place?: string
/** Optional supplied delivery note shown under the shipping line. */
note?: string
}
export type FreeBookHero4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type FreeBookHero4Copy = {
freeLabel: string
freeLine: string
investmentLabel: string
/** {rate} (bold) and {country} are replaced. */
rateLine: string
/** Follows the investment label when regions exist but none is chosen. */
chooseLine: string
/** Follows the investment label when no regions are supplied. */
laterLine: string
/** {country} is replaced. */
unavailableLine: string
unavailableNote: string
stepLabel: string
formTitle: string
nameLabel: string
namePlaceholder: string
emailLabel: string
emailPlaceholder: string
countryLabel: string
countryPlaceholder: string
/** {label} is replaced with the field label in lower case. */
required: string
emailRequired: string
emailInvalid: string
countryRequired: string
errorSummary: string
loading: string
disabledNote: string
}
export type FreeBookHero4Props = {
/** Labels, live shipping lines, validation and status copy. Named placeholders are documented on FreeBookHero4Copy. */
copy?: Partial<FreeBookHero4Copy>
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: string
/** The book lying open on a desk (slot: scene). Without it, the card sits without the photo. */
sceneImage?: string
sceneImageAlt?: string
/** object-position for the photo, e.g. '50% 45%'. */
imagePosition?: string
chaptersTitle?: string
chapters?: FreeBookHero4Chapter[]
bookName?: string
bookDetail?: string
/** Supplied per-region shipping rates. When empty, the country field is hidden and shipping is shown on the next step. */
regions?: FreeBookHero4Region[]
defaultCountry?: string
ctaLabel?: string
/** The plain secondary line under the button. */
quietLine?: string
/** Optional destination for the quiet line. */
quietHref?: string
privacy?: string
state?: FreeBookHero4State
/** Receives the validated values (name, email, country code) and the chosen region. A returned promise shows the loading label until it settles. */
onSubmit?: (values: Record<string, string>, region?: FreeBookHero4Region) => void | Promise<void>
id?: string
className?: string
style?: React.CSSProperties
}
type Key = 'name' | 'email' | 'country'
type Values = Record<Key, string>
const KEYS: Key[] = ['name', 'email', 'country']
const NO_REGIONS: FreeBookHero4Region[] = []
const DEFAULT_COPY: FreeBookHero4Copy = {
freeLabel: 'FREE',
freeLine: 'The book is free.',
investmentLabel: 'Your investment:',
rateLine: '{rate} shipping to {country}.',
chooseLine: 'just the shipping. Pick your country to see it.',
laterLine: 'just the shipping, shown on the next step.',
unavailableLine: 'We don’t ship to {country} yet, so we can’t send your copy there.',
unavailableNote: 'Choose another country to continue.',
stepLabel: 'Step 1 of 2',
formTitle: 'Where should we send your copy?',
nameLabel: 'Full name',
namePlaceholder: 'Jordan Rivera',
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
countryLabel: 'Country',
countryPlaceholder: 'Choose your country…',
required: 'Please enter your {label}.',
emailRequired: 'Please enter your email address.',
emailInvalid: 'Please enter a valid email, like you@example.com.',
countryRequired: 'Choose your country so we can price your shipping.',
errorSummary: 'Please fix the highlighted fields to claim your free book.',
loading: 'Saving your details…',
disabledNote: 'Requests are paused right now.',
}
const DEFAULT_CHAPTERS: FreeBookHero4Chapter[] = [
{ title: 'The 48-hour follow-up', teaser: 'Why the second call wins more jobs than the first estimate ever does.' },
{ title: 'Price the job, not the hour', teaser: 'How to quote with confidence and stop discounting at the kitchen table.' },
{ title: 'The handover question', teaser: 'The one thing to ask on the last day that fills next month’s calendar.' },
]
export function FreeBookHero4({
copy,
headline = 'Turn more estimates into signed jobs',
highlight = 'signed jobs',
lead = 'Follow up fast, price with confidence and close at the kitchen table without the hard sell. Get the book free. You just cover the shipping.',
sceneImage,
sceneImageAlt = 'The book lying open on a desk',
imagePosition = '50% 50%',
chaptersTitle = 'Three chapters to read the night it arrives',
chapters = DEFAULT_CHAPTERS,
bookName = 'Sales Systems for Contractors',
bookDetail = 'Paperback · mailed to your door',
regions = NO_REGIONS,
defaultCountry,
ctaLabel = 'Send Me My FREE Book',
quietLine = 'or keep reading to see what’s inside',
quietHref,
privacy = 'We respect your inbox. Unsubscribe anytime.',
state = 'default',
onSubmit,
id,
className,
style,
}: FreeBookHero4Props) {
const text = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const mounted = React.useRef(true)
const needsCountry = regions.length > 0
const start = (): Values => ({ name: '', email: '', country: defaultCountry ?? '' })
const [values, setValues] = React.useState<Values>(start)
const [errors, setErrors] = React.useState<Partial<Values>>(() => (state === 'error' ? collect(start(), text, needsCountry) : {}))
const [tried, setTried] = React.useState(state === 'error')
const [loading, setLoading] = React.useState(false)
React.useEffect(() => {
const fresh = start()
setValues(fresh)
setErrors(state === 'error' ? collect(fresh, text, needsCountry) : {})
setTried(state === 'error')
setLoading(false)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const region = needsCountry ? regions.find((item) => item.code === values.country) : undefined
const place = region ? region.place ?? region.label : ''
const unavailable = Boolean(region && !region.rate)
const disabled = state === 'disabled'
const hasErrors = KEYS.some((key) => errors[key])
const forced = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : ''
const shipId = `${uid}-ship`
const noteId = `${uid}-note`
const lineKey = unavailable ? `off-${values.country}` : region ? `rate-${region.code}` : needsCountry ? 'pick' : 'later'
const quiet = disabled ? text.disabledNote : unavailable ? text.unavailableNote : quietLine
const quietLink = Boolean(quietHref) && !disabled && !unavailable
function change(key: Key, value: string) {
setValues((prev) => ({ ...prev, [key]: value }))
if (errors[key] || key === 'country') setErrors((prev) => patch(prev, key, check(key, value, text, needsCountry)))
}
function blur(key: Key) {
setErrors((prev) => patch(prev, key, check(key, values[key], text, needsCountry)))
}
async function submit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (disabled || loading || unavailable) return
const next = collect(values, text, needsCountry)
setErrors(next)
setTried(true)
const first = KEYS.find((key) => next[key])
if (first) {
document.getElementById(`${uid}-${first}`)?.focus()
return
}
const payload: Record<string, string> = { name: values.name.trim(), email: values.email.trim() }
if (needsCountry) payload.country = values.country
const result = onSubmit?.(payload, region)
if (!result) return
setLoading(true)
try {
await result
} finally {
if (mounted.current) setLoading(false)
}
}
function input(key: 'name' | 'email', label: string, placeholder: string) {
const fid = `${uid}-${key}`
const err = errors[key]
const email = key === 'email'
return (
<div className='fb4__f'>
<label className='fb4__label' htmlFor={fid}>{label}</label>
<input
id={fid}
className='fb4__input'
name={key}
type={email ? 'email' : 'text'}
inputMode={email ? 'email' : undefined}
autoComplete={email ? 'email' : 'name'}
spellCheck={email ? false : undefined}
placeholder={placeholder}
value={values[key]}
aria-invalid={err ? true : undefined}
aria-describedby={err ? `${fid}-err` : undefined}
onChange={(event) => change(key, event.target.value)}
onBlur={() => blur(key)}
/>
{err ? (
<p className='fb4__err' id={`${fid}-err`}>
<AlertCircle className='fb4__ico' aria-hidden='true' strokeWidth={2.5} />
{err}
</p>
) : null}
</div>
)
}
const countryId = `${uid}-country`
const countryErr = errors.country
const btnClass = ['fb4__btn', forced.trim(), loading ? 'is-loading' : ''].filter(Boolean).join(' ')
return (
<section
id={id}
className={['cf-free-book-hero-4', sceneImage ? '' : 'is-plain', className].filter(Boolean).join(' ')}
style={{ '--fb4-focus': imagePosition, ...style } as React.CSSProperties}
aria-labelledby={`${uid}-h`}
>
<style>{CSS}</style>
<div className='fb4__grid'>
{sceneImage ? (
<div className='fb4__photo'>
<div className='fb4__stick'>
<img className='fb4__img' src={sceneImage} alt={sceneImageAlt} width={1024} height={1536} decoding='async' />
</div>
</div>
) : null}
<div className='fb4__main'>
<header className='fb4__head fb4__rise'>
<h1 id={`${uid}-h`} className='fb4__h1'>{mark(headline, highlight)}</h1>
{lead ? <p className='fb4__lead'>{lead}</p> : null}
</header>
{chapters.length ? (
<div className='fb4__chapters fb4__rise' style={{ '--i': 1 } as React.CSSProperties}>
{chaptersTitle ? <h2 className='fb4__chtitle'>{chaptersTitle}</h2> : null}
<ol className='fb4__rail'>
{chapters.map((chapter, i) => (
<li className='fb4__ch' key={`${i}-${chapter.title}`}>
<span className='fb4__num' aria-hidden='true'>{chapter.number ?? String(i + 1).padStart(2, '0')}</span>
<div className='fb4__chbody'>
<h3 className='fb4__chname'>{chapter.title}</h3>
{chapter.teaser ? <p className='fb4__teaser'>{chapter.teaser}</p> : null}
</div>
</li>
))}
</ol>
</div>
) : null}
<div className='fb4__card fb4__rise' style={{ '--i': 2 } as React.CSSProperties}>
<div className='fb4__offer'>
<p className='fb4__free'>{text.freeLabel}</p>
<div>
<h2 className='fb4__book'>{bookName}</h2>
{bookDetail ? <p className='fb4__detail'>{bookDetail}</p> : null}
</div>
</div>
<p id={shipId} className={unavailable ? 'fb4__ship is-off' : 'fb4__ship'} aria-live='polite'>
<span key={lineKey} className='fb4__ship-in'>
{unavailable ? (
<>
<PackageX className='fb4__ico fb4__ico--warn' aria-hidden='true' strokeWidth={2.5} />
{fill(text.unavailableLine, { country: place })}
</>
) : (
<>
<Truck className='fb4__ico fb4__ico--accent' aria-hidden='true' strokeWidth={2.5} />
{text.freeLine} <span className='fb4__sc'>{text.investmentLabel}</span>{' '}
{region?.rate ? fillParts(text.rateLine, { rate: region.rate, country: place }, 'rate') : needsCountry ? text.chooseLine : text.laterLine}
</>
)}
</span>
</p>
{region?.note && !unavailable ? <p className='fb4__ship-note'>{region.note}</p> : null}
<form className='fb4__form' noValidate onSubmit={submit} aria-labelledby={`${uid}-ft`}>
<p className='fb4__step'>
<span className='fb4__bar' aria-hidden='true'><i /><i /></span>
{text.stepLabel}
</p>
<h3 id={`${uid}-ft`} className='fb4__ftitle'>{text.formTitle}</h3>
<div className='fb4__fields'>
{input('name', text.nameLabel, text.namePlaceholder)}
{input('email', text.emailLabel, text.emailPlaceholder)}
{needsCountry ? (
<div className='fb4__f fb4__f--wide'>
<label className='fb4__label' htmlFor={countryId}>{text.countryLabel}</label>
<div className='fb4__select'>
<select
id={countryId}
className={values.country ? 'fb4__selectel' : 'fb4__selectel is-empty'}
name='country'
autoComplete='country'
value={values.country}
aria-invalid={countryErr ? true : undefined}
aria-describedby={[countryErr ? `${countryId}-err` : '', shipId].filter(Boolean).join(' ')}
onChange={(event) => change('country', event.target.value)}
onBlur={() => blur('country')}
>
<option value='' disabled>{text.countryPlaceholder}</option>
{regions.map((item) => (
<option key={item.code} value={item.code}>{item.label}</option>
))}
</select>
<ChevronDown className='fb4__chev' aria-hidden='true' strokeWidth={2.5} />
</div>
{countryErr ? (
<p className='fb4__err' id={`${countryId}-err`}>
<AlertCircle className='fb4__ico' aria-hidden='true' strokeWidth={2.5} />
{countryErr}
</p>
) : null}
</div>
) : null}
</div>
{tried && hasErrors ? (
<p className='fb4__summary' role='alert'>
<AlertCircle className='fb4__ico' aria-hidden='true' strokeWidth={2.5} />
{text.errorSummary}
</p>
) : null}
<button
type='submit'
className={btnClass}
disabled={disabled || unavailable || loading}
aria-busy={loading || undefined}
aria-describedby={unavailable ? shipId : quiet ? noteId : undefined}
>
{loading ? (
<>
<Loader2 className='fb4__spin' aria-hidden='true' strokeWidth={2.5} />
{text.loading}
</>
) : (
ctaLabel
)}
</button>
{quiet ? (
<p id={noteId} className='fb4__quiet'>
{quietLink ? <a className='fb4__quiet-link' href={quietHref}>{quiet}</a> : quiet}
</p>
) : null}
{privacy ? (
<p className='fb4__privacy'>
<Lock className='fb4__ico' aria-hidden='true' strokeWidth={2.5} />
{privacy}
</p>
) : null}
</form>
</div>
</div>
</div>
</section>
)
}
export default FreeBookHero4
function mark(value: string, phrase?: string) {
const at = phrase ? value.toLowerCase().indexOf(phrase.toLowerCase()) : -1
if (!phrase || at < 0) return value
return (
<>
{value.slice(0, at)}
<span className='fb4__mark'>{value.slice(at, at + phrase.length)}</span>
{value.slice(at + phrase.length)}
</>
)
}
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((out, key) => out.split(`{${key}}`).join(vars[key]), template)
}
function fillParts(template: string, vars: Record<string, string>, strong: string) {
const parts: React.ReactNode[] = []
let rest = template
let n = 0
while (rest) {
const open = rest.indexOf('{')
const close = open < 0 ? -1 : rest.indexOf('}', open)
if (close < 0) {
parts.push(<React.Fragment key={n}>{rest}</React.Fragment>)
break
}
if (open > 0) parts.push(<React.Fragment key={n++}>{rest.slice(0, open)}</React.Fragment>)
const name = rest.slice(open + 1, close)
const value = name in vars ? vars[name] : rest.slice(open, close + 1)
parts.push(name === strong ? <strong key={n++}>{value}</strong> : <React.Fragment key={n++}>{value}</React.Fragment>)
rest = rest.slice(close + 1)
}
return parts
}
function looksLikeEmail(value: string) {
const at = value.indexOf('@')
if (at < 1 || value.includes(' ')) return false
const domain = value.slice(at + 1)
const dot = domain.lastIndexOf('.')
return dot > 0 && dot < domain.length - 2
}
function check(key: Key, raw: string, text: FreeBookHero4Copy, needsCountry: boolean) {
const value = raw.trim()
if (key === 'country') return needsCountry && !value ? text.countryRequired : ''
if (key === 'email') {
if (!value) return text.emailRequired
return looksLikeEmail(value) ? '' : text.emailInvalid
}
return value ? '' : fill(text.required, { label: text.nameLabel.toLowerCase() })
}
function collect(values: Values, text: FreeBookHero4Copy, needsCountry: boolean) {
const out: Partial<Values> = {}
for (const key of KEYS) {
const message = check(key, values[key], text, needsCountry)
if (message) out[key] = message
}
return out
}
function patch(prev: Partial<Values>, key: Key, message: string): Partial<Values> {
const next = { ...prev }
if (message) next[key] = message
else delete next[key]
return next
}
const CSS = `
.cf-free-book-hero-4{--fb4-gutter:clamp(16px,5vw,48px);--fb4-pad:clamp(32px,4vw,56px);--fb4-overlap:clamp(40px,5.5vw,96px);--fb4-line:oklch(from var(--ink,#151c2c) l c h / .14);position:relative;isolation:isolate;background:var(--surface,#fff);color:var(--ink,#151c2c);font-family:var(--font-body,Arial,sans-serif);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;overflow-x:clip}
.cf-free-book-hero-4 *,.cf-free-book-hero-4 *::before,.cf-free-book-hero-4 *::after{box-sizing:border-box}
.cf-free-book-hero-4 :where(h1,h2,h3,p,ol){margin:0}
.cf-free-book-hero-4 :where(h1,h2,h3){text-wrap:balance}
.cf-free-book-hero-4 :where(p,li){text-wrap:pretty}
.cf-free-book-hero-4 .fb4__grid{display:grid;grid-template-columns:minmax(var(--fb4-gutter),1fr) minmax(0,500px) minmax(0,620px) minmax(var(--fb4-gutter),1fr)}
.cf-free-book-hero-4 .fb4__photo{grid-column:1/3;grid-row:1;position:relative;overflow:clip;min-height:100%;background:color-mix(in oklch,var(--ink,#151c2c) 6%,var(--surface,#fff))}
.cf-free-book-hero-4 .fb4__stick{position:absolute;inset:0}
=======
.cf-free-book-hero-4 .fb4__img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:var(--fb4-focus,50% 50%)}
.cf-free-book-hero-4 .fb4__main{grid-column:3;grid-row:1;position:relative;z-index:1;min-width:0;padding:clamp(56px,8vw,112px) 0 clamp(64px,8.5vw,120px) var(--fb4-pad)}
.cf-free-book-hero-4.is-plain .fb4__main{grid-column:2/4;padding-left:0;max-width:46rem}
.cf-free-book-hero-4.is-plain .fb4__card{margin-left:0}
.cf-free-book-hero-4 .fb4__h1{font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.6vw,4.25rem);line-height:1.04;letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);color:var(--ink,#151c2c)}
.cf-free-book-hero-4 .fb4__mark{background-image:linear-gradient(transparent 52%,color-mix(in oklch,var(--marker,#fae37c) 80%,transparent) 52%,color-mix(in oklch,var(--marker,#fae37c) 80%,transparent) 92%,transparent 92%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-inline:.06em;margin-inline:-.06em;border-radius:.12em}
.cf-free-book-hero-4 .fb4__lead{margin-top:20px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:color-mix(in oklch,var(--ink,#151c2c) 84%,var(--surface,#fff))}
.cf-free-book-hero-4 .fb4__chapters{margin-top:40px}
.cf-free-book-hero-4 .fb4__chtitle{margin-bottom:16px;font-family:var(--font-body,Arial,sans-serif);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;line-height:1.3;letter-spacing:0;color:var(--ink,#151c2c)}
.cf-free-book-hero-4 .fb4__rail{list-style:none;padding:0;display:grid}
.cf-free-book-hero-4 .fb4__ch{position:relative;display:grid;grid-template-columns:56px minmax(0,1fr);gap:16px;padding-bottom:20px}
.cf-free-book-hero-4 .fb4__ch:last-child{padding-bottom:0}
.cf-free-book-hero-4 .fb4__ch:not(:last-child)::before{content:'';position:absolute;left:27px;top:38px;bottom:4px;width:2px;border-radius:2px;background:var(--fb4-line)}
.cf-free-book-hero-4 .fb4__num{display:block;padding-top:2px;text-align:center;font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;font-variant-numeric:tabular-nums;color:var(--accent,#2563eb)}
.cf-free-book-hero-4 .fb4__chbody{min-width:0}
.cf-free-book-hero-4 .fb4__chname{padding-top:2px;font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--ink,#151c2c)}
.cf-free-book-hero-4 .fb4__teaser{margin-top:8px;color:var(--muted,#4b5563)}
.cf-free-book-hero-4 .fb4__card{margin-top:40px;margin-left:calc(-1 * (var(--fb4-pad) + var(--fb4-overlap)));padding:clamp(20px,3vw,32px);background:var(--card,#fff);color:var(--ink,#151c2c);border:1px solid oklch(from var(--accent,#2563eb) l c h / .3);border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(.22 .03 260 / .22),0 12px 24px -8px oklch(.22 .03 260 / .32)))}
.cf-free-book-hero-4 .fb4__offer{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:20px}
.cf-free-book-hero-4 .fb4__free{font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;color:var(--accent,#2563eb)}
.cf-free-book-hero-4 .fb4__book{font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--ink,#151c2c)}
.cf-free-book-hero-4 .fb4__detail{margin-top:4px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4b5563)}
.cf-free-book-hero-4 .fb4__ship{margin-top:20px;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink,#151c2c) 4%,var(--card,#fff));color:var(--ink,#151c2c);line-height:1.45}
.cf-free-book-hero-4 .fb4__ship.is-off{background:var(--warning-soft,color-mix(in oklch,var(--warning,#8a6a00) 14%,var(--card,#fff)))}
.cf-free-book-hero-4 .fb4__ship-in{display:block}
.cf-free-book-hero-4 .fb4__ship strong{font-weight:800}
.cf-free-book-hero-4 .fb4__sc{font-weight:800;color:var(--ink,#151c2c)}
.cf-free-book-hero-4 .fb4__ship-note{margin-top:8px;padding-inline:16px;font-size:.9375rem;line-height:1.4;color:var(--muted,#4b5563)}
.cf-free-book-hero-4 .fb4__ico{display:inline-block;width:1.05em;height:1.05em;flex:none;vertical-align:-.17em;margin-inline-end:.45em}
.cf-free-book-hero-4 .fb4__ico--accent{color:var(--accent,#2563eb)}
.cf-free-book-hero-4 .fb4__ico--warn{color:var(--warning,#8a6a00)}
.cf-free-book-hero-4 .fb4__form{margin-top:24px}
.cf-free-book-hero-4 .fb4__step{display:flex;align-items:center;gap:12px;margin-bottom:12px;font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#4b5563)}
.cf-free-book-hero-4 .fb4__bar{display:inline-flex;gap:4px}
.cf-free-book-hero-4 .fb4__bar i{display:block;width:24px;height:6px;border-radius:999px;background:color-mix(in oklch,var(--ink,#151c2c) 12%,var(--card,#fff))}
.cf-free-book-hero-4 .fb4__bar i:first-child{background:var(--accent-fill,var(--accent,#2563eb))}
.cf-free-book-hero-4 .fb4__ftitle{margin-bottom:16px;font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;color:var(--ink,#151c2c)}
.cf-free-book-hero-4 .fb4__fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px}
.cf-free-book-hero-4 .fb4__f{min-width:0}
.cf-free-book-hero-4 .fb4__f--wide{grid-column:1/-1}
.cf-free-book-hero-4 .fb4__label{display:block;margin-bottom:8px;font-size:1rem;font-weight:700;line-height:1.25;color:var(--label-ink,var(--ink,#151c2c))}
.cf-free-book-hero-4 .fb4__input,.cf-free-book-hero-4 .fb4__selectel{display:block;width:100%;height:56px;margin:0;padding:0 16px;font:inherit;font-family:var(--font-body,Arial,sans-serif);font-size:1.0625rem;line-height:1.2;color:var(--field-ink,#151c2c);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#151c2c) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .08);-webkit-appearance:none;appearance:none}
.cf-free-book-hero-4 .fb4__input::placeholder{color:color-mix(in oklch,var(--field-ink,#151c2c) 65%,var(--field,#fff));opacity:1}
.cf-free-book-hero-4 .fb4__input:hover,.cf-free-book-hero-4 .fb4__selectel:hover{border-color:color-mix(in oklch,var(--ink,#151c2c) 42%,transparent)}
.cf-free-book-hero-4 .fb4__input:focus-visible,.cf-free-book-hero-4 .fb4__selectel:focus-visible{outline:none;border-color:var(--field-focus,var(--accent,#2563eb));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2563eb)) l c h / .35)}
.cf-free-book-hero-4 .fb4__input[aria-invalid='true'],.cf-free-book-hero-4 .fb4__selectel[aria-invalid='true']{border-color:var(--danger,#b42318)}
.cf-free-book-hero-4 .fb4__input[aria-invalid='true']:focus-visible,.cf-free-book-hero-4 .fb4__selectel[aria-invalid='true']:focus-visible{border-color:var(--danger,#b42318);box-shadow:0 0 0 3px oklch(from var(--danger,#b42318) l c h / .3)}
.cf-free-book-hero-4 .fb4__select{position:relative}
.cf-free-book-hero-4 .fb4__selectel{padding-right:48px;cursor:pointer}
.cf-free-book-hero-4 .fb4__selectel.is-empty{color:color-mix(in oklch,var(--field-ink,#151c2c) 65%,var(--field,#fff))}
.cf-free-book-hero-4 .fb4__selectel option{color:var(--field-ink,#151c2c);background:var(--field,#fff)}
.cf-free-book-hero-4 .fb4__chev{position:absolute;right:16px;top:50%;width:20px;height:20px;margin-top:-10px;color:var(--field-ink,#151c2c);pointer-events:none}
.cf-free-book-hero-4 .fb4__err{margin-top:8px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger,#b42318)}
.cf-free-book-hero-4 .fb4__summary{margin-top:16px;padding:12px 16px;border-radius:10px;background:var(--danger-soft,color-mix(in oklch,var(--danger,#b42318) 14%,var(--card,#fff)));color:var(--danger,#b42318);font-size:.9375rem;font-weight:600;line-height:1.4}
.cf-free-book-hero-4 .fb4__btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:24px;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-weight:var(--button-weight,800);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-transform:var(--button-case,none);text-shadow:var(--button-text-shadow,none);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(--shadow,oklch(.22 .03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .42));cursor:pointer}
.cf-free-book-hero-4 .fb4__btn:hover:not(:disabled),.cf-free-book-hero-4 .fb4__btn.is-hover:not(:disabled){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 + .12) 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(--shadow,oklch(.22 .03 260)) l c h / .32),0 12px 20px -6px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .5))}
.cf-free-book-hero-4 .fb4__btn:active:not(:disabled),.cf-free-book-hero-4 .fb4__btn.is-active:not(:disabled){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 - .09) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .24) c h / .5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3);transform:translateY(1px)}
.cf-free-book-hero-4 .fb4__btn:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px}
.cf-free-book-hero-4 .fb4__btn:disabled{background:var(--button-2-bg,var(--secondary,#e8ebf0));color:var(--button-2-ink,var(--secondary-ink,#151c2c));text-shadow:none;box-shadow:none;cursor:not-allowed;transform:none}
.cf-free-book-hero-4 .fb4__btn.is-loading:disabled{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));text-shadow:var(--button-text-shadow,none);cursor:progress}
.cf-free-book-hero-4 .fb4__spin{width:20px;height:20px;flex:none}
.cf-free-book-hero-4 .fb4__btn{text-wrap:balance}
.cf-free-book-hero-4 .fb4__quiet{margin-top:12px;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4b5563)}
.cf-free-book-hero-4 .fb4__quiet-link{color:var(--muted,#4b5563);text-decoration:underline;text-decoration-color:oklch(from var(--muted,#4b5563) l c h / .5);text-underline-offset:.18em;border-radius:4px}
.cf-free-book-hero-4 .fb4__quiet-link:hover{color:var(--ink,#151c2c);text-decoration-color:currentColor}
.cf-free-book-hero-4 .fb4__quiet-link:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:2px}
.cf-free-book-hero-4 .fb4__privacy{margin-top:8px;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4b5563)}
@media (max-width:860px){
.cf-free-book-hero-4 .fb4__grid{grid-template-columns:var(--fb4-gutter) minmax(0,1fr) var(--fb4-gutter)}
.cf-free-book-hero-4 .fb4__photo{grid-column:1/-1;grid-row:1;height:clamp(200px,54vw,340px)}
.cf-free-book-hero-4 .fb4__stick{position:absolute;inset:0;height:auto;max-height:none}
.cf-free-book-hero-4 .fb4__main,.cf-free-book-hero-4.is-plain .fb4__main{grid-column:2;grid-row:2;max-width:none;padding:32px 0 64px}
.cf-free-book-hero-4.is-plain .fb4__main{padding-top:56px}
.cf-free-book-hero-4 .fb4__card{margin-left:0}
}
@media (max-width:640px){
.cf-free-book-hero-4 .fb4__chapters{margin-top:32px}
.cf-free-book-hero-4 .fb4__chtitle{margin-bottom:12px}
.cf-free-book-hero-4 .fb4__ch{grid-template-columns:32px minmax(0,1fr);gap:12px;padding-bottom:12px}
.cf-free-book-hero-4 .fb4__ch:not(:last-child)::before{display:none}
.cf-free-book-hero-4 .fb4__num,.cf-free-book-hero-4 .fb4__chname{padding-top:0;font-size:1.0625rem;line-height:1.35;letter-spacing:0}
.cf-free-book-hero-4 .fb4__teaser{display:none}
.cf-free-book-hero-4 .fb4__card{margin-top:32px}
.cf-free-book-hero-4 .fb4__offer{gap:16px}
.cf-free-book-hero-4 .fb4__btn{padding:12px 16px;font-size:1.0625rem}
}
@keyframes fb4-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes fb4-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:no-preference){
.cf-free-book-hero-4 .fb4__rise{animation:fb4-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
.cf-free-book-hero-4 .fb4__ship-in{animation:fb4-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-free-book-hero-4 .fb4__spin{animation:fb4-spin .8s linear infinite}
.cf-free-book-hero-4 .fb4__input,.cf-free-book-hero-4 .fb4__selectel{transition:border-color .16s ease,box-shadow .16s ease}
.cf-free-book-hero-4 .fb4__btn{transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-free-book-hero-4 .fb4__btn:hover:not(:disabled),.cf-free-book-hero-4 .fb4__btn.is-hover:not(:disabled){transform:translateY(-1px)}
.cf-free-book-hero-4 .fb4__btn:active:not(:disabled),.cf-free-book-hero-4 .fb4__btn.is-active:not(:disabled){transform:translateY(1px)}
.cf-free-book-hero-4 .fb4__quiet-link{transition:color .16s ease}
}
`
pieces/hero/free-book-hero-4/specimen.tsx 43 lines
import __studioImaged2d3d79e from "../assets/2106171f83bc71f9.webp";
import { FreeBookHero4, type FreeBookHero4State } from '../free-book-hero-4'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
const CHAPTERS = [
{ title: 'The 48-hour follow-up', teaser: 'Why the second call wins more jobs than the first estimate ever does.' },
{ title: 'Price the job, not the hour', teaser: 'How to quote with confidence and stop discounting at the kitchen table.' },
{ title: 'The handover question', teaser: 'The one thing to ask on the last day that fills next month’s calendar.' },
]
const REGIONS = [
{ code: 'US', label: 'United States', place: 'the United States', rate: '$7.95' },
{ code: 'CA', label: 'Canada', rate: '$12.95' },
{ code: 'GB', label: 'United Kingdom', place: 'the United Kingdom', rate: '$14.95' },
{ code: 'AU', label: 'Australia', rate: '$16.95' },
{ code: 'MX', label: 'Mexico' },
]
export default function FreeBookHero4Specimen({ state = 'default' }: { state?: FreeBookHero4State }) {
return (
<FreeBookHero4
state={state}
headline='Turn more estimates into signed jobs'
highlight='signed jobs'
lead='Follow up fast, price with confidence and close at the kitchen table without the hard sell. Get the book free. You just cover the shipping.'
sceneImage={slot('scene', __studioImaged2d3d79e)}
sceneImageAlt='Sales Systems for Contractors lying open on a workshop desk beside a tape measure and a mug of coffee'
imagePosition='38% 50%'
chaptersTitle='Three chapters to read the night it arrives'
chapters={CHAPTERS}
bookName='Sales Systems for Contractors'
bookDetail='Paperback · mailed to your door'
regions={REGIONS}
ctaLabel='Send Me My FREE Book'
quietLine='or keep reading to see what’s inside'
privacy={defaults.sample.registration.privacy}
copy={{ nameLabel: defaults.sample.fields[0].label, emailLabel: defaults.sample.fields[1].label }}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalFreeBookHero4 |
Partial<FreeBookHero4Copy> |
|
headline OptionalFreeBookHero4 |
string |
Default 'Turn more estimates into signed jobs'
|
highlight OptionalFreeBookHero4 |
string |
Default 'signed jobs'
|
lead OptionalFreeBookHero4 |
string |
Default 'Follow up fast, price with confidence and close at the kitchen table without the hard sell. Get the book free. You just cover the shipping.'
|
sceneImage OptionalFreeBookHero4 |
string |
|
sceneImageAlt OptionalFreeBookHero4 |
string |
Default 'The book lying open on a desk'
|
imagePosition OptionalFreeBookHero4 |
string |
Default '50% 50%'
|
chaptersTitle OptionalFreeBookHero4 |
string |
Default 'Three chapters to read the night it arrives'
|
chapters OptionalFreeBookHero4 |
FreeBookHero4Chapter[] |
Default DEFAULT_CHAPTERS
|
bookName OptionalFreeBookHero4 |
string |
Default 'Sales Systems for Contractors'
|
bookDetail OptionalFreeBookHero4 |
string |
Default 'Paperback · mailed to your door'
|
regions OptionalFreeBookHero4 |
FreeBookHero4Region[] |
Default NO_REGIONS
|
defaultCountry OptionalFreeBookHero4 |
string |
|
ctaLabel OptionalFreeBookHero4 |
string |
Default 'Send Me My FREE Book'
|
quietLine OptionalFreeBookHero4 |
string |
Default 'or keep reading to see what’s inside'
|
quietHref OptionalFreeBookHero4 |
string |
|
privacy OptionalFreeBookHero4 |
string |
Default 'We respect your inbox. Unsubscribe anytime.'
|
state OptionalFreeBookHero4 |
FreeBookHero4State |
Default 'default'
|
onSubmit OptionalFreeBookHero4 |
(values: Record<string, string>, region?: FreeBookHero4Region) => void | Promise<void> |
|
id OptionalFreeBookHero4 |
string |
|
className OptionalFreeBookHero4 |
string |
|
style OptionalFreeBookHero4 |
React.CSSProperties |
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- Secondary button.
--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-border--field-focus--field-ink--field-radius- 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.
scene- A wide atmosphere photo behind or beside the copy.
-
2106171f83bc71f9.webp
image/webp · 78.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB