Local Service Hero 2
Local service hero: a full-bleed photo of the work with a card breaking its edge that asks for the visitor's zip,
Use it in a prompt
Use hero/local-service-hero-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/hero/local-service-hero-2.tsx. - Import it and pass your copy and images (Props tab):
import { LocalServiceHero2 } from "@/components/funneldna/hero/local-service-hero-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/local-service-hero-2/component.tsx 580 lines
// layout: photo-overlap-card
// Local service hero: a full-bleed photo of the work with a card breaking its edge that asks for the visitor's zip,
// answers "do we serve you?" inline from the supplied area list (the first yes), then puts book and call one tap away.
import React from "react";
import { AlertCircle, BadgeCheck, Check, Clock, MapPin, Phone, Receipt, ShieldCheck, Star, Wrench } from "lucide-react";
export type LocalServiceArea = {
/** area name used in the answer and the area chips */
name: string;
/** zip codes or postcode prefixes; a typed code matches when it starts with one of them */
codes: string[];
};
export type LocalServiceHero2Trust = {
title: string;
detail?: string;
/** lucide icon for the point (default service) */
icon?: "licensed" | "upfront" | "guarantee" | "on-time" | "service";
};
export type LocalServiceAreaResult =
| { kind: "yes"; code: string; area: string }
| { kind: "no"; code: string }
| { kind: "error"; code: string; message: string };
export type LocalServiceHero2Copy = {
checkLabel: string;
checkPlaceholder: string;
checkButton: string;
errorEmpty: string;
errorInvalid: string;
/** "{area}" is replaced */
yesTitle: string;
yesDetail: string;
/** "{code}" is replaced */
noTitle: string;
/** "{phone}" becomes a call link */
noDetail: string;
/** used when no phone is supplied */
noDetailNoPhone: string;
};
const COPY: LocalServiceHero2Copy = {
checkLabel: "Check if we serve your street",
checkPlaceholder: "80120",
checkButton: "Check",
errorEmpty: "Type your zip or postcode to check.",
errorInvalid: "That doesn't look like a full zip or postcode. Check it and try again.",
yesTitle: "Yes! We serve {area}.",
yesDetail: "Your street is covered. Book your visit below or call us now.",
noTitle: "Not in {code} yet.",
noDetail: "Call {phone} and we'll tell you who can help.",
noDetailNoPhone: "We're not booking visits there yet.",
};
const TRUST_ICONS = { licensed: BadgeCheck, upfront: Receipt, guarantee: ShieldCheck, "on-time": Clock, service: Wrench };
/** US zip (5 or 9 digits), UK postcode or Canadian postal code, upper-cased with spaces and hyphens removed */
const DEFAULT_CODE = /^(\d{5}(\d{4})?|[A-Z]{1,2}\d[A-Z\d]?\d[A-Z]{2}|[A-Z]\d[A-Z]\d[A-Z]\d)$/;
export type LocalServiceHero2Props = {
/** outcome headline for the area served */
headline?: string;
/** phrase inside the headline drawn with one marker stroke */
headlineMark?: string;
/** one short sentence per line */
lead?: string[];
/** single-word line set in the display face after the lead */
punch?: string;
/** supplied service-area list; the area check shows only when it has entries */
areas?: LocalServiceArea[];
/** validates the code after upper-casing and removing spaces and hyphens */
codePattern?: RegExp;
copy?: Partial<LocalServiceHero2Copy>;
/** code shown in the field on first render */
defaultCode?: string;
/** called with every answer the area check shows */
onCheck?: (result: LocalServiceAreaResult) => void;
/** supplied price beside what the alternative costs; hidden when absent */
price?: { amount: string; label: string; alternative?: string };
bookLabel?: string;
/** when set, the book button links here */
bookHref?: string;
/** book click; receives the checked code and area when there is one */
onAction?: (details: { code?: string; area?: string }) => void;
phone?: string;
/** defaults to a tel: link built from phone */
phoneHref?: string;
/** "{phone}" is replaced */
callLabel?: string;
onCall?: () => void;
/** one short line under the buttons */
reassurance?: string;
/** photo of the work at a customer's home (scene slot) */
image?: string;
imageAlt?: string;
/** object-position for the photo; keep the subject clear of the card */
imagePosition?: string;
/** supplied rating only; hidden when absent */
rating?: { score: number; count?: string };
/** "{count}" is replaced */
ratingLabel?: string;
ratingLabelNoCount?: string;
/** supplied trust points only */
trust?: LocalServiceHero2Trust[];
/** line above the area chips */
areasLabel?: string;
/** phones: fixed tap-to-call bar; "auto" shows it once the card's buttons scroll away */
stickyCall?: "auto" | "always" | "off";
/** "{phone}" is replaced */
stickyLabel?: string;
state?: "default" | "hover" | "active" | "disabled" | "error" | "success";
className?: string;
};
export function LocalServiceHero2(props: LocalServiceHero2Props) {
const {
headline = "Get it fixed right by a local pro",
headlineMark = "fixed right",
lead = ["Type your zip below.", "You'll see right away if a tech covers your street."],
punch = "Simple.",
areas = [],
codePattern = DEFAULT_CODE,
copy: copyIn,
defaultCode,
onCheck,
price,
bookLabel = "Yes! Book my visit",
bookHref,
onAction,
phone,
phoneHref,
callLabel = "Call {phone}",
onCall,
reassurance,
image,
imageAlt = "",
imagePosition = "68% 40%",
rating,
ratingLabel = "average from {count}",
ratingLabelNoCount = "out of 5",
trust = [],
areasLabel = "Our techs are booking visits in",
stickyCall = "auto",
stickyLabel = "Call {phone}",
state = "default",
className,
} = props;
const copy: LocalServiceHero2Copy = { ...COPY, ...copyIn };
const uid = React.useId();
const ids = { h1: `${uid}-h1`, code: `${uid}-code`, answer: `${uid}-answer` };
const disabled = state === "disabled";
const callHref = phoneHref ?? (phone ? `tel:${phone.replace(/[^\d+]/g, "")}` : undefined);
const hasCheck = areas.length > 0;
const forced = state === "error" || state === "success";
const check = (raw: string): LocalServiceAreaResult => {
const shown = raw.trim().toUpperCase();
const n = normalize(raw);
if (!n) return { kind: "error", code: shown, message: copy.errorEmpty };
if (!codePattern.test(n)) return { kind: "error", code: shown, message: copy.errorInvalid };
const hit = areas.find((a) =>
a.codes.some((c) => {
const nc = normalize(c);
return nc.length > 0 && n.startsWith(nc);
}),
);
return hit ? { kind: "yes", code: shown, area: hit.name } : { kind: "no", code: shown };
};
const [code, setCode] = React.useState(defaultCode ?? "");
const [result, setResult] = React.useState<LocalServiceAreaResult | null>(() =>
forced && hasCheck ? check(defaultCode ?? "") : null,
);
const first = React.useRef(true);
React.useEffect(() => {
if (first.current) {
first.current = false;
return;
}
setCode(defaultCode ?? "");
setResult(forced && hasCheck ? check(defaultCode ?? "") : null);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state, defaultCode]);
const actionsRef = React.useRef<HTMLDivElement>(null);
const [actionsInView, setActionsInView] = React.useState(true);
React.useEffect(() => {
if (stickyCall !== "auto" || !callHref) return;
const el = actionsRef.current;
if (!el || typeof IntersectionObserver === "undefined") return;
const io = new IntersectionObserver(([entry]) => setActionsInView(entry.isIntersecting));
io.observe(el);
return () => io.disconnect();
}, [stickyCall, callHref]);
const stickyShown = stickyCall === "always" || (stickyCall === "auto" && !actionsInView);
const inputRef = React.useRef<HTMLInputElement>(null);
const run = (raw: string) => {
const r = check(raw);
setResult(r);
onCheck?.(r);
return r;
};
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const v = e.target.value;
setCode(v);
const n = normalize(v);
if (n && codePattern.test(n)) run(v);
else if (!n || (result && result.kind !== "error")) setResult(null);
};
const handleBlur = () => {
const n = normalize(code);
if (n && !codePattern.test(n)) setResult(check(code));
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (disabled) return;
const r = run(code);
if (r.kind === "error") inputRef.current?.focus();
};
const handleBook = (e: React.MouseEvent<HTMLElement>) => {
if (disabled) {
e.preventDefault();
return;
}
onAction?.({
code: result && result.kind !== "error" ? result.code : undefined,
area: result?.kind === "yes" ? result.area : undefined,
});
};
const at = headlineMark ? headline.indexOf(headlineMark) : -1;
const h1 =
at < 0 ? (
headline
) : (
<>
{headline.slice(0, at)}
<span className="cf-lsh2__mark">{headlineMark}</span>
{headline.slice(at + headlineMark.length)}
</>
);
let answer: React.ReactNode = null;
if (result?.kind === "error") {
answer = (
<p className="cf-lsh2__err" key="err">
<AlertCircle className="cf-lsh2__inl" size={16} strokeWidth={2.5} aria-hidden />
{result.message}
</p>
);
} else if (result?.kind === "yes") {
answer = (
<div className="cf-lsh2__msg cf-lsh2__msg--yes" key={`yes-${result.code}`}>
<span className="cf-lsh2__badge" aria-hidden>
<Check size={16} strokeWidth={3} />
</span>
<p className="cf-lsh2__msg-txt">
<strong>{fill(copy.yesTitle, { area: result.area })}</strong>
<span>{copy.yesDetail}</span>
</p>
</div>
);
} else if (result?.kind === "no") {
const parts = copy.noDetail.split("{phone}");
const detail =
phone && callHref ? (
parts.length > 1 ? (
<>
{parts[0]}
<a href={callHref} onClick={() => onCall?.()}>
{phone}
</a>
{parts.slice(1).join(phone)}
</>
) : (
copy.noDetail
)
) : (
copy.noDetailNoPhone
);
answer = (
<div className="cf-lsh2__msg cf-lsh2__msg--no" key={`no-${result.code}`}>
<span className="cf-lsh2__badge cf-lsh2__badge--no" aria-hidden>
<MapPin size={16} strokeWidth={2.5} />
</span>
<p className="cf-lsh2__msg-txt">
<strong>{fill(copy.noTitle, { code: result.code })}</strong>
<span>{detail}</span>
</p>
</div>
);
}
const matched = result?.kind === "yes" ? result.area : undefined;
const bookClass = ["cf-lsh2__book", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""]
.filter(Boolean)
.join(" ");
const callText = fill(callLabel, { phone: phone ?? "" });
const stars = rating ? Math.max(0, Math.min(5, Math.round(rating.score))) : 0;
const showSide = !!rating || trust.length > 0 || areas.length > 0;
return (
<section className={["cf-lsh2", className].filter(Boolean).join(" ")} aria-labelledby={ids.h1}>
<style>{CSS}</style>
<figure className="cf-lsh2__photo">
{image ? (
<img src={image} alt={imageAlt} width={1600} height={900} loading="eager" decoding="async" style={{ objectPosition: imagePosition }} />
) : null}
</figure>
<div className="cf-lsh2__wrap">
<div className="cf-lsh2__card">
<h1 className="cf-lsh2__h1" id={ids.h1}>
{h1}
</h1>
{lead.length || punch ? (
<div className="cf-lsh2__lead">
{lead.map((line) => (
<p key={line}>{line}</p>
))}
{punch ? <p className="cf-lsh2__punch">{punch}</p> : null}
</div>
) : null}
{hasCheck ? (
<form className="cf-lsh2__check" onSubmit={handleSubmit} noValidate>
<label className="cf-lsh2__label" htmlFor={ids.code}>
{copy.checkLabel}
</label>
<div className="cf-lsh2__row">
<div className="cf-lsh2__field">
<MapPin size={20} strokeWidth={2.5} aria-hidden />
<input
ref={inputRef}
id={ids.code}
className="cf-lsh2__input"
name="postalCode"
type="text"
inputMode="text"
autoComplete="postal-code"
autoCapitalize="characters"
spellCheck={false}
maxLength={10}
placeholder={copy.checkPlaceholder}
value={code}
onChange={handleChange}
onBlur={handleBlur}
aria-invalid={result?.kind === "error" ? true : undefined}
aria-describedby={ids.answer}
disabled={disabled}
/>
</div>
<button type="submit" className="cf-lsh2__btn2" disabled={disabled}>
{copy.checkButton}
</button>
</div>
<div id={ids.answer} className="cf-lsh2__answer" role="status" aria-live="polite">
{answer}
</div>
</form>
) : null}
{price ? (
<p className="cf-lsh2__price">
<span className="cf-lsh2__amt">{price.amount}</span>
<span className="cf-lsh2__ptxt">
<strong>{price.label}</strong>
{price.alternative ? <span>{price.alternative}</span> : null}
</span>
</p>
) : null}
<div className="cf-lsh2__actions" ref={actionsRef}>
{bookHref && !disabled ? (
<a className={bookClass} href={bookHref} onClick={handleBook}>
{bookLabel}
</a>
) : (
<button type="button" className={bookClass} onClick={handleBook} disabled={disabled}>
{bookLabel}
</button>
)}
{callHref ? (
disabled ? (
<button type="button" className="cf-lsh2__btn2 cf-lsh2__call" disabled>
<Phone size={20} strokeWidth={2.5} aria-hidden />
{callText}
</button>
) : (
<a className="cf-lsh2__btn2 cf-lsh2__call" href={callHref} onClick={() => onCall?.()}>
<Phone size={20} strokeWidth={2.5} aria-hidden />
{callText}
</a>
)
) : null}
</div>
{reassurance ? (
<p className="cf-lsh2__note">
<ShieldCheck className="cf-lsh2__inl" size={16} strokeWidth={2.5} aria-hidden />
{reassurance}
</p>
) : null}
</div>
{showSide ? (
<div className="cf-lsh2__side">
{rating ? (
<p className="cf-lsh2__rating">
<span className="cf-lsh2__stars" aria-hidden>
{[0, 1, 2, 3, 4].map((i) => (
<Star key={i} size={20} strokeWidth={2.5} fill="currentColor" className={i < stars ? undefined : "cf-lsh2__star-off"} />
))}
</span>
<span>
<strong className="cf-lsh2__score">{rating.score.toFixed(1)}</strong>
{rating.count ? fill(ratingLabel, { count: rating.count }) : ratingLabelNoCount}
</span>
</p>
) : null}
{trust.length ? (
<ul className="cf-lsh2__trust">
{trust.map((t) => {
const Icon = TRUST_ICONS[t.icon ?? "service"];
return (
<li key={t.title}>
<span className="cf-lsh2__disc" aria-hidden>
<Icon size={20} strokeWidth={2.5} />
</span>
<div className="cf-lsh2__ttxt">
<strong className="cf-lsh2__ttitle">{t.title}</strong>
{t.detail ? <span className="cf-lsh2__tdetail">{t.detail}</span> : null}
</div>
</li>
);
})}
</ul>
) : null}
{areas.length ? (
<div>
<p className="cf-lsh2__areas-label">{areasLabel}</p>
<ul className="cf-lsh2__chips">
{areas.map((a) => (
<li key={a.name} className="cf-lsh2__chip" data-on={matched === a.name ? "" : undefined}>
<MapPin size={16} strokeWidth={2.5} aria-hidden />
{a.name}
</li>
))}
</ul>
</div>
) : null}
</div>
) : null}
</div>
{callHref && stickyCall !== "off" && !disabled ? (
<div className="cf-lsh2__sticky" data-shown={stickyShown ? "" : undefined}>
<a className="cf-lsh2__book" href={callHref} onClick={() => onCall?.()}>
<Phone size={20} strokeWidth={2.5} aria-hidden />
{fill(stickyLabel, { phone: phone ?? "" })}
</a>
</div>
) : null}
</section>
);
}
export default LocalServiceHero2;
function normalize(v: string) {
return v.toUpperCase().replace(/[\s-]/g, "");
}
function fill(template: string, map: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (m, k: string) => (k in map ? map[k] : m));
}
const CSS = `
.cf-lsh2{--lsh2-photo:clamp(380px,42vw,600px);--lsh2-overlap:clamp(180px,20vw,300px);--lsh2-gutter:clamp(16px,5vw,48px);--lsh2-shadow:var(--shadow,oklch(0.22 0.03 260));position:relative;background:var(--surface,#ffffff);color:var(--ink,#1b2433);font-family:var(--font-body,inherit);padding-bottom:clamp(64px,8.5vw,120px);overflow-x:clip}
.cf-lsh2 *,.cf-lsh2 *::before,.cf-lsh2 *::after{box-sizing:border-box}
.cf-lsh2__photo{position:relative;height:var(--lsh2-photo);margin:0;overflow:hidden;background:var(--band,#1f2f4d)}
.cf-lsh2__photo img{position:absolute;inset:0;width:100%;height:100%;display:block;object-fit:cover}
.cf-lsh2__photo::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(to top,oklch(from var(--band,#1f2f4d) l c h / .34),transparent 42%),linear-gradient(to right,oklch(from var(--band,#1f2f4d) l c h / .2),transparent 58%)}
.cf-lsh2__wrap{position:relative;z-index:1;width:min(calc(100% - 2 * var(--lsh2-gutter)),1120px);margin:calc(var(--lsh2-overlap) * -1) auto 0;display:grid;grid-template-columns:minmax(0,36rem) minmax(0,1fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-lsh2__card{min-width:0;background:var(--card,#ffffff);color:var(--ink,#1b2433);border:1px solid var(--card-border,oklch(from var(--ink,#1b2433) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--lsh2-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--lsh2-shadow) l c h / .32)));padding:clamp(24px,3vw,32px);animation:lsh2-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-lsh2__h1{margin:0 0 16px;font-family:var(--font-display,inherit);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--ink,#1b2433);text-wrap:balance}
.cf-lsh2__mark{padding:0 .06em;border-radius:.14em;background:linear-gradient(transparent 52%,color-mix(in oklch,var(--marker,#fae37c) 72%,transparent) 52%,color-mix(in oklch,var(--marker,#fae37c) 72%,transparent) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-lsh2__lead{display:grid;gap:4px;margin:0 0 24px}
.cf-lsh2__lead p{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted,#4b5563);text-wrap:pretty}
.cf-lsh2__lead .cf-lsh2__punch{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);color:var(--ink,#1b2433)}
.cf-lsh2__label{display:block;margin:0 0 8px;font-size:1.0625rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink,#1b2433))}
.cf-lsh2__row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.cf-lsh2__field{position:relative;min-width:0}
.cf-lsh2__field>svg{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink,#1b2433) 65%,var(--field,#ffffff));pointer-events:none}
.cf-lsh2__input{display:block;width:100%;height:56px;margin:0;padding:0 16px 0 46px;font-family:var(--font-body,inherit);font-size:1.0625rem;font-weight:700;letter-spacing:.04em;background:var(--field,#ffffff);color:var(--field-ink,#1b2433);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#1b2433) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));transition:border-color .16s ease,box-shadow .16s ease;appearance:none}
.cf-lsh2__input::placeholder{color:color-mix(in oklch,var(--field-ink,#1b2433) 65%,var(--field,#ffffff));opacity:1;font-weight:500;letter-spacing:normal}
.cf-lsh2__input:hover:not(:disabled):not(:focus){border-color:color-mix(in oklch,var(--field-ink,#1b2433) 42%,var(--field,#ffffff))}
.cf-lsh2__input:focus{outline:none;border-color:var(--field-focus,var(--accent,#2457c5));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2457c5)) l c h / .35)}
.cf-lsh2__input[aria-invalid="true"]{border-color:var(--danger,#b42318)}
.cf-lsh2__input[aria-invalid="true"]:focus{box-shadow:0 0 0 3px oklch(from var(--danger,#b42318) l c h / .3)}
.cf-lsh2__input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink,#1b2433) 5%,var(--field,#ffffff))}
.cf-lsh2__answer{margin-top:12px}
.cf-lsh2__answer:empty{margin-top:0}
.cf-lsh2__err{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger,#b42318);text-wrap:pretty}
.cf-lsh2__inl{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-lsh2__msg{display:flex;align-items:flex-start;gap:12px;margin:0;padding:14px 16px;border-radius:10px;animation:lsh2-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-lsh2__msg--yes{background:var(--success-soft,#e7f4ec)}
.cf-lsh2__msg--no{background:color-mix(in oklch,var(--ink,#1b2433) 4%,var(--card,#ffffff))}
.cf-lsh2__badge{flex:0 0 auto;display:grid;place-items:center;width:28px;height:28px;border-radius:999px;background:var(--success,#1f7a45);color:var(--lsh2-badge-ink,#ffffff)}
.cf-lsh2__badge--no{background:var(--ink,#1b2433);color:var(--card,#ffffff)}
.cf-lsh2__msg-txt{display:grid;gap:2px;min-width:0;margin:0;font-size:.9375rem;line-height:1.4;color:var(--ink,#1b2433);text-wrap:pretty}
.cf-lsh2__msg-txt strong{font-size:1.0625rem;line-height:1.3;font-weight:800}
.cf-lsh2__msg--yes strong{color:var(--success,#1f7a45)}
.cf-lsh2__msg a{color:var(--link,var(--accent,#2457c5));font-weight:700;text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent,#2457c5)) l c h / .45);text-underline-offset:.18em}
.cf-lsh2__msg a:hover{color:oklch(from var(--link,var(--accent,#2457c5)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-lsh2__msg a:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2457c5));outline-offset:2px;border-radius:4px}
.cf-lsh2__price{display:flex;align-items:center;gap:16px;margin:24px 0 0;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink,#1b2433) 4%,var(--card,#ffffff))}
.cf-lsh2__amt{flex:0 0 auto;font-family:var(--font-display,inherit);font-size:clamp(2rem,3vw,2.5rem);line-height:1;font-weight:var(--display-weight,800);letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink,#1b2433)}
.cf-lsh2__ptxt{display:grid;gap:2px;min-width:0;font-size:.9375rem;line-height:1.35;color:var(--muted,#4b5563);text-wrap:pretty}
.cf-lsh2__ptxt strong{font-size:1.0625rem;font-weight:700;color:var(--ink,#1b2433)}
.cf-lsh2__actions{display:grid;gap:12px;margin-top:16px}
.cf-lsh2__book{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin:0;padding:10px 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,#ffffff));font-family:var(--button-font,var(--font-display,inherit));font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-decoration:none;text-wrap:balance;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(--lsh2-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--lsh2-shadow) l c h / .38));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-lsh2__book:hover,.cf-lsh2__book.is-hover{background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2,#b42318)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .2) c h),0 1px 2px oklch(from var(--lsh2-shadow) l c h / .32),0 10px 18px -6px oklch(from var(--lsh2-shadow) l c h / .44))}
.cf-lsh2__book:active,.cf-lsh2__book.is-active{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - .16) c h),0 1px 1px oklch(from var(--lsh2-shadow) l c h / .25)}
.cf-lsh2__book:focus-visible,.cf-lsh2__btn2:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2457c5));outline-offset:3px}
.cf-lsh2__book:disabled{cursor:not-allowed;transform:none;background:var(--secondary,#e5e7eb);color:color-mix(in oklch,var(--secondary-ink,#1b2433) 62%,var(--secondary,#e5e7eb));box-shadow:none;text-shadow:none}
.cf-lsh2__btn2{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:56px;margin:0;padding:0 20px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary,#e5e7eb));color:var(--button-2-ink,var(--secondary-ink,#1b2433));font-family:var(--button-font,var(--font-display,inherit));font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-decoration:none;white-space:nowrap;box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(from var(--lsh2-shadow) l c h / .2)));cursor:pointer;transition:transform .16s ease,background .16s ease,box-shadow .16s ease}
.cf-lsh2__btn2:hover{background:color-mix(in oklch,var(--button-2-ink,var(--secondary-ink,#1b2433)) 9%,var(--button-2-bg,var(--secondary,#e5e7eb)))}
.cf-lsh2__btn2:active{transform:translateY(1px);box-shadow:none}
.cf-lsh2__btn2:disabled{cursor:not-allowed;transform:none;box-shadow:none;color:color-mix(in oklch,var(--button-2-ink,var(--secondary-ink,#1b2433)) 55%,var(--button-2-bg,var(--secondary,#e5e7eb)))}
.cf-lsh2__call{width:100%}
.cf-lsh2__actions .cf-lsh2__book{min-height:72px}
.cf-lsh2__note{margin:12px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#4b5563);text-wrap:pretty}
.cf-lsh2__note svg{color:var(--success,#1f7a45)}
.cf-lsh2__side{display:grid;gap:32px;min-width:0;padding-top:calc(var(--lsh2-overlap) + 40px)}
.cf-lsh2__rating{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0;font-size:1.0625rem;line-height:1.4;color:var(--ink,#1b2433)}
.cf-lsh2__stars{display:inline-flex;gap:2px;color:var(--accent-fill,var(--accent,#2457c5))}
.cf-lsh2__star-off{color:color-mix(in oklch,var(--ink,#1b2433) 16%,var(--surface,#ffffff))}
.cf-lsh2__score{font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);font-weight:800;font-variant-numeric:tabular-nums;margin-inline-end:.3em}
.cf-lsh2__trust{display:grid;gap:16px;margin:0;padding:0;list-style:none}
.cf-lsh2__trust li{display:grid;grid-template-columns:40px minmax(0,1fr);gap:16px;align-items:start}
.cf-lsh2__disc{display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:var(--accent-fill,var(--accent,#2457c5));color:var(--accent-fill-ink,var(--card,#ffffff))}
.cf-lsh2__ttxt{min-width:0;padding-top:8px}
.cf-lsh2__ttitle{display:block;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.35;font-weight:700;color:var(--ink,#1b2433)}
.cf-lsh2__tdetail{display:block;margin-top:2px;font-size:.9375rem;line-height:1.4;color:var(--muted,#4b5563);text-wrap:pretty}
.cf-lsh2__areas-label{margin:0 0 12px;font-size:1.0625rem;line-height:1.35;font-weight:700;color:var(--ink,#1b2433)}
.cf-lsh2__chips{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.cf-lsh2__chip{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 12px;border:1px solid transparent;border-radius:999px;background:color-mix(in oklch,var(--ink,#1b2433) 6%,var(--surface,#ffffff));color:var(--ink,#1b2433);font-size:.875rem;line-height:1.2;font-weight:800;transition:background .16s ease,border-color .16s ease}
.cf-lsh2__chip svg{color:var(--muted,#4b5563)}
.cf-lsh2__chip[data-on]{background:color-mix(in oklch,var(--accent,#2457c5) 12%,var(--surface,#ffffff));border-color:oklch(from var(--accent,#2457c5) l c h / .55);animation:lsh2-pop .3s ease both}
.cf-lsh2__chip[data-on] svg{color:var(--accent,#2457c5)}
.cf-lsh2__sticky{display:none}
@keyframes lsh2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes lsh2-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@media (max-width:960px){
.cf-lsh2__wrap{grid-template-columns:minmax(0,1fr);gap:40px}
.cf-lsh2__card,.cf-lsh2__side{width:100%;max-width:40rem;justify-self:center}
.cf-lsh2__side{padding-top:0}
}
@media (max-width:720px){
.cf-lsh2{--lsh2-photo:clamp(220px,62vw,300px);--lsh2-overlap:56px}
.cf-lsh2__wrap{gap:32px}
.cf-lsh2__card{padding:24px 20px}
.cf-lsh2__book{padding:10px 16px}
.cf-lsh2__actions .cf-lsh2__book{min-height:64px;padding:10px 12px}
.cf-lsh2__price{gap:12px;padding:14px 16px}
.cf-lsh2__sticky{display:block;position:fixed;left:0;right:0;bottom:0;z-index:40;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:var(--card,#ffffff);box-shadow:0 -1px 2px oklch(from var(--lsh2-shadow) l c h / .16),0 -10px 18px -10px oklch(from var(--lsh2-shadow) l c h / .34);transform:translateY(110%);visibility:hidden;transition:transform .28s cubic-bezier(.2,.7,.2,1),visibility 0s linear .28s}
.cf-lsh2__sticky[data-shown]{transform:none;visibility:visible;transition:transform .28s cubic-bezier(.2,.7,.2,1),visibility 0s}
.cf-lsh2__sticky .cf-lsh2__book{min-height:56px}
}
@media (max-width:420px){
.cf-lsh2{--lsh2-gutter:12px}
}
@media (prefers-reduced-motion:reduce){
.cf-lsh2__card,.cf-lsh2__msg,.cf-lsh2__chip[data-on]{animation:none}
.cf-lsh2__book,.cf-lsh2__btn2,.cf-lsh2__input,.cf-lsh2__chip,.cf-lsh2__sticky,.cf-lsh2__sticky[data-shown]{transition:none}
}
`;
pieces/hero/local-service-hero-2/specimen.tsx 48 lines
import __studioImage25b69aa7 from "../assets/bbcd47af7234d901.webp";
import React from "react";
import { LocalServiceHero2 } from "../local-service-hero-2";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error", "success"];
type SpecimenState = "default" | "hover" | "active" | "disabled" | "error" | "success";
const AREAS = [
{ name: "Littleton", codes: ["80120", "80122", "80123", "80127", "80128"] },
{ name: "Centennial", codes: ["80015", "80016", "80111", "80112", "80121"] },
{ name: "Highlands Ranch", codes: ["80126", "80129", "80130"] },
{ name: "Englewood", codes: ["80110", "80113"] },
{ name: "Lone Tree", codes: ["80124"] },
];
export default function LocalServiceHero2Specimen({ state = "default" }: { state?: SpecimenState }) {
const sampleCode = state === "error" ? "8012" : state === "success" ? "80126" : undefined;
return (
<LocalServiceHero2
state={state}
defaultCode={sampleCode}
headline="Heat and AC fixed right, all across Denver's south side"
headlineMark="fixed right"
lead={["Type your zip below.", "In one second you'll know if a Northstar tech covers your street."]}
punch="Simple."
areas={AREAS}
price={{ amount: "$89", label: "Diagnostic visit", alternative: "vs. $189 for an after-hours call-out" }}
bookLabel="Yes! Book my $89 visit"
phone="(303) 555-0148"
reassurance="No obligation. Your price is agreed before any work starts."
rating={{ score: 4.9, count: "812 local reviews" }}
trust={[
{ title: "Licensed and insured techs", detail: "Background-checked, in marked vans", icon: "licensed" },
{ title: "Your price before we start", detail: "No surprise add-ons on the invoice", icon: "upfront" },
{ title: "Two-hour arrival window", detail: "A text when your tech is 20 minutes out", icon: "on-time" },
]}
areasLabel="Northstar techs are booking visits in"
image={slot(
"scene",
__studioImage25b69aa7,
)}
imageAlt="A heating and air technician checks an outdoor AC unit beside a family home while the homeowner looks on"
imagePosition="70% 62%"
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalLocalServiceHero2 |
string |
|
headlineMark OptionalLocalServiceHero2 |
string |
|
lead OptionalLocalServiceHero2 |
string[] |
|
punch OptionalLocalServiceHero2 |
string |
|
areas OptionalLocalServiceHero2 |
LocalServiceArea[] |
|
codePattern OptionalLocalServiceHero2 |
RegExp |
|
copy OptionalLocalServiceHero2 |
Partial<LocalServiceHero2Copy> |
|
defaultCode OptionalLocalServiceHero2 |
string |
|
onCheck OptionalLocalServiceHero2 |
(result: LocalServiceAreaResult) => void |
|
price OptionalLocalServiceHero2 |
{ amount: string; label: string; alternative?: string } |
|
bookLabel OptionalLocalServiceHero2 |
string |
|
bookHref OptionalLocalServiceHero2 |
string |
|
onAction OptionalLocalServiceHero2 |
(details: { code?: string; area?: string }) => void |
|
phone OptionalLocalServiceHero2 |
string |
|
phoneHref OptionalLocalServiceHero2 |
string |
|
callLabel OptionalLocalServiceHero2 |
string |
|
onCall OptionalLocalServiceHero2 |
() => void |
|
reassurance OptionalLocalServiceHero2 |
string |
|
image OptionalLocalServiceHero2 |
string |
|
imageAlt OptionalLocalServiceHero2 |
string |
|
imagePosition OptionalLocalServiceHero2 |
string |
|
rating OptionalLocalServiceHero2 |
{ score: number; count?: string } |
|
ratingLabel OptionalLocalServiceHero2 |
string |
|
ratingLabelNoCount OptionalLocalServiceHero2 |
string |
|
trust OptionalLocalServiceHero2 |
LocalServiceHero2Trust[] |
|
areasLabel OptionalLocalServiceHero2 |
string |
|
stickyCall OptionalLocalServiceHero2 |
"auto" | "always" | "off" |
|
stickyLabel OptionalLocalServiceHero2 |
string |
|
state OptionalLocalServiceHero2 |
"default" | "hover" | "active" | "disabled" | "error" | "success" |
|
className OptionalLocalServiceHero2 |
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.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-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.
-
bbcd47af7234d901.webp
image/webp · 100 KB