Local Service Hero 1
Local service hero: the outcome headline for the area served, a call button that answers the visitor's question,
Use it in a prompt
Use hero/local-service-hero 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.tsx. - Import it and pass your copy and images (Props tab):
import { LocalServiceHero } from "@/components/funneldna/hero/local-service-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/local-service-hero/component.tsx 704 lines
// layout: sticky-offer-side
// Local service hero: the outcome headline for the area served, a call button that answers the visitor's question,
// supplied rating and trust points, and a sticky quick-quote box with a value reveal, so the next step is always one tap away.
import React from "react";
import { AlertCircle, BadgeCheck, ChevronDown, Clock, Loader2, MapPin, Phone, ShieldCheck, Star, Wrench } from "lucide-react";
export type LocalServiceTrustPoint = {
title: string;
detail?: string;
/** lucide icon: licensed, same-day, guarantee or service (default) */
icon?: "licensed" | "same-day" | "guarantee" | "service";
};
export type LocalServiceQuoteValues = { service: string; name: string; phone: string };
export type LocalServiceOffer = {
/** what the extra is, shown above its value */
valueLabel?: string;
/** the total value, shown first and big */
value: string;
/** small word after the value */
valueWord?: string;
/** the turn, e.g. "But you won't pay that." */
but?: string;
/** today's price, revealed below the value */
price: string;
priceNote?: string;
};
export type LocalServiceQuoteCopy = {
title: string;
serviceLabel: string;
servicePlaceholder: string;
services: string[];
nameLabel: string;
namePlaceholder: string;
phoneLabel: string;
phonePlaceholder: string;
submitLabel: string;
busyLabel: string;
note: string;
errorService: string;
errorName: string;
errorPhone: string;
errorPhoneInvalid: string;
};
const QUOTE_COPY: LocalServiceQuoteCopy = {
title: "Get your free quote",
serviceLabel: "What do you need help with?",
servicePlaceholder: "Choose a service…",
services: ["Repair", "New installation", "Inspection", "Something else"],
nameLabel: "Full name",
namePlaceholder: "Jane Smith",
phoneLabel: "Phone",
phonePlaceholder: "(555) 123-4567",
submitLabel: "Send my free quote",
busyLabel: "Sending…",
note: "No obligation. We only use your details for your quote.",
errorService: "Choose the service you need.",
errorName: "Enter your name so we know who to ask for.",
errorPhone: "Enter a phone number we can reach you on.",
errorPhoneInvalid: "That number looks too short. Check it and try again.",
};
const TRUST_ICONS = { licensed: BadgeCheck, "same-day": Clock, guarantee: ShieldCheck, service: Wrench };
export type LocalServiceHeroProps = {
/** outcome headline; name the area served */
headline?: string;
/** phrase inside the headline drawn with one marker stroke */
headlineMark?: string;
lead?: string;
/** service-area line under the lead, e.g. "Serving Austin and Round Rock" */
areaLine?: string;
/** supplied rating only; hidden when absent */
rating?: { score: number; count?: string };
/** "{score}" and "{count}" are replaced */
ratingLabel?: string;
/** used when no count is supplied; "{score}" is replaced */
ratingLabelNoCount?: string;
/** the question the call button answers */
question?: string;
phone?: string;
/** defaults to a tel: link built from phone */
phoneHref?: string;
/** "{phone}" is replaced */
callLabel?: string;
onCall?: () => void;
bookLabel?: string;
/** when set, book buttons link here instead of opening the quote form */
bookHref?: string;
onBook?: () => void;
/** one short line under the buttons */
reassurance?: string;
psLabel?: string;
ps?: string;
/** team or van photo (scene slot) */
image?: string;
imageAlt?: string;
imageCaption?: string;
trust?: LocalServiceTrustPoint[];
showForm?: boolean;
/** phones: start with the quote form expanded */
defaultFormOpen?: boolean;
form?: Partial<LocalServiceQuoteCopy>;
/** value reveal at the top of the quote box; hidden when absent */
offer?: LocalServiceOffer;
onSubmit?: (values: LocalServiceQuoteValues) => void;
/** shows the sending state on the submit button */
busy?: boolean;
/** line under the quote box; "{phone}" becomes a call link */
talkLabel?: string;
/** desktop: keep the quote box in view while the left side scrolls */
stickyOffer?: boolean;
/** phones: fixed call / quote bar once the hero's actions and quote box scroll away */
stickyBar?: boolean;
barCallLabel?: string;
barQuoteLabel?: string;
/** accessible name of the sticky bar */
barLabel?: string;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
type QuoteErrors = Partial<Record<keyof LocalServiceQuoteValues, string>>;
export function LocalServiceHero(props: LocalServiceHeroProps) {
const {
headline = "Get it fixed today by a local pro",
headlineMark = "fixed today",
lead = "Tell us what's wrong and a local pro will quote up front, show up on time and finish the job.",
areaLine,
rating,
ratingLabel = "{score} stars from {count} reviews",
ratingLabelNoCount = "{score} out of 5 stars",
question = "Need it fixed today?",
phone,
phoneHref,
callLabel = "Yes, call {phone}",
onCall,
bookLabel = "Book online",
bookHref,
onBook,
reassurance,
psLabel = "P.S.",
ps,
image,
imageAlt = "",
imageCaption,
trust = [],
showForm = true,
defaultFormOpen = false,
form,
offer,
onSubmit,
busy = false,
talkLabel = "Prefer to talk? Call {phone}",
stickyOffer = true,
stickyBar = false,
barCallLabel = "Call now",
barQuoteLabel = "Free quote",
barLabel = "Quick actions",
state = "default",
className,
} = props;
const copy: LocalServiceQuoteCopy = { ...QUOTE_COPY, ...form };
const uid = React.useId();
const ids = { h1: `${uid}-h1`, form: `${uid}-form`, service: `${uid}-service`, name: `${uid}-name`, phone: `${uid}-phone` };
const disabled = state === "disabled";
const [values, setValues] = React.useState<LocalServiceQuoteValues>({ service: "", name: "", phone: "" });
const [errors, setErrors] = React.useState<QuoteErrors>({});
const [submitted, setSubmitted] = React.useState(false);
const [open, setOpen] = React.useState(defaultFormOpen);
const [wide, setWide] = React.useState(false);
const [barShow, setBarShow] = React.useState(false);
const [focusForm, setFocusForm] = React.useState(false);
const actionsRef = React.useRef<HTMLDivElement>(null);
const cardRef = React.useRef<HTMLDivElement>(null);
const toggleRef = React.useRef<HTMLButtonElement>(null);
const serviceRef = React.useRef<HTMLSelectElement>(null);
const nameRef = React.useRef<HTMLInputElement>(null);
const phoneRef = React.useRef<HTMLInputElement>(null);
const expanded = wide || open || state === "error";
const tel = phoneHref ?? (phone ? `tel:${phone.replace(/[^\d+]/g, "")}` : undefined);
const validate = (v: LocalServiceQuoteValues): QuoteErrors => {
const next: QuoteErrors = {};
if (!v.service) next.service = copy.errorService;
if (!v.name.trim()) next.name = copy.errorName;
const digits = v.phone.replace(/\D/g, "").length;
if (!digits) next.phone = copy.errorPhone;
else if (digits < 7) next.phone = copy.errorPhoneInvalid;
return next;
};
const err = state === "error" && !submitted ? validate(values) : errors;
React.useEffect(() => {
if (typeof window === "undefined" || !window.matchMedia) return;
const mq = window.matchMedia("(min-width: 960px)");
const sync = () => setWide(mq.matches);
sync();
mq.addEventListener("change", sync);
return () => mq.removeEventListener("change", sync);
}, []);
React.useEffect(() => {
if (!stickyBar || typeof IntersectionObserver === "undefined") return;
const targets = [actionsRef.current, cardRef.current].filter((n): n is HTMLDivElement => Boolean(n));
const seen = new Map<Element, boolean>();
const io = new IntersectionObserver((entries) => {
entries.forEach((entry) => seen.set(entry.target, entry.isIntersecting));
setBarShow(!Array.from(seen.values()).some(Boolean));
});
targets.forEach((t) => io.observe(t));
return () => io.disconnect();
}, [stickyBar, showForm]);
React.useEffect(() => {
if (!focusForm || !expanded) return;
setFocusForm(false);
if (!wide) {
const reduce = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
cardRef.current?.scrollIntoView({ behavior: reduce ? "auto" : "smooth", block: "start" });
}
serviceRef.current?.focus({ preventScroll: !wide });
}, [focusForm, expanded, wide]);
const guard = (fn?: () => void) => (e: React.MouseEvent<HTMLElement>) => {
if (disabled) {
e.preventDefault();
return;
}
fn?.();
};
const goToForm = () => {
if (disabled) return;
onBook?.();
if (!showForm) return;
setOpen(true);
setFocusForm(true);
};
const update = (key: keyof LocalServiceQuoteValues) => (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => {
const next = { ...values, [key]: e.target.value };
setValues(next);
if (submitted) setErrors(validate(next));
};
const submit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (disabled || busy) return;
const next = validate(values);
setSubmitted(true);
setErrors(next);
if (next.service) serviceRef.current?.focus();
else if (next.name) nameRef.current?.focus();
else if (next.phone) phoneRef.current?.focus();
else onSubmit?.({ ...values });
};
const onCardKey = (e: React.KeyboardEvent<HTMLDivElement>) => {
if (e.key !== "Escape" || wide || !open) return;
e.stopPropagation();
setOpen(false);
toggleRef.current?.focus();
};
const pressCls = state === "hover" ? " is-hover" : state === "active" ? " is-active" : "";
const heroPrimary = `lsh-btn lsh-btn--primary lsh-btn--hero${pressCls}`;
const bookCls = phone ? "lsh-btn lsh-btn--secondary lsh-btn--hero" : heroPrimary;
const canQuote = Boolean(bookHref) || showForm || Boolean(onBook);
const callButton = phone ? (
<a className={heroPrimary} href={disabled ? undefined : tel} role={disabled ? "link" : undefined} aria-disabled={disabled || undefined} onClick={guard(onCall)}>
<Phone size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{fill(callLabel, { phone })}</span>
</a>
) : null;
const bookButton = bookHref ? (
<a className={bookCls} href={disabled ? undefined : bookHref} role={disabled ? "link" : undefined} aria-disabled={disabled || undefined} onClick={guard(onBook)}>
{bookLabel}
</a>
) : canQuote ? (
<button type="button" className={bookCls} disabled={disabled} aria-controls={showForm ? ids.form : undefined} aria-expanded={showForm ? expanded : undefined} onClick={goToForm}>
{bookLabel}
</button>
) : null;
const bar = stickyBar && (phone || canQuote) ? (
<div className="lsh-bar" role="region" aria-label={barLabel} aria-hidden={!barShow || undefined} data-show={String(barShow)}>
{phone && (
<a className="lsh-btn lsh-btn--primary lsh-btn--bar" href={disabled ? undefined : tel} tabIndex={barShow ? undefined : -1} role={disabled ? "link" : undefined} aria-disabled={disabled || undefined} onClick={guard(onCall)}>
<Phone size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{barCallLabel}</span>
</a>
)}
{canQuote && (bookHref ? (
<a className={`lsh-btn ${phone ? "lsh-btn--secondary" : "lsh-btn--primary"} lsh-btn--bar`} href={disabled ? undefined : bookHref} tabIndex={barShow ? undefined : -1} role={disabled ? "link" : undefined} aria-disabled={disabled || undefined} onClick={guard(onBook)}>
{barQuoteLabel}
</a>
) : (
<button type="button" className={`lsh-btn ${phone ? "lsh-btn--secondary" : "lsh-btn--primary"} lsh-btn--bar`} tabIndex={barShow ? undefined : -1} disabled={disabled} onClick={goToForm}>
{barQuoteLabel}
</button>
))}
</div>
) : null;
return (
<section className={`cf-local-service-hero${className ? ` ${className}` : ""}`} aria-labelledby={ids.h1}>
<style>{CSS}</style>
<div className="lsh-wrap" data-form={String(showForm)} data-sticky={String(stickyOffer)}>
<div className="lsh-intro">
{rating && (
<p className="lsh-rating lsh-rise" style={rise(0)}>
<span className="lsh-stars" aria-hidden="true">
{[0, 1, 2, 3, 4].map((i) => (
<Star key={i} size={20} strokeWidth={2.5} className={i < Math.round(rating.score) ? "lsh-star" : "lsh-star lsh-star--empty"} />
))}
</span>
<span>
{fillNodes(rating.count ? ratingLabel : ratingLabelNoCount, {
score: <strong>{rating.score.toFixed(1)}</strong>,
count: rating.count ?? "",
})}
</span>
</p>
)}
<h1 id={ids.h1} className="lsh-h1 lsh-rise" style={rise(1)}>
{renderHeadline(headline, headlineMark)}
</h1>
{lead && <p className="lsh-lead lsh-rise" style={rise(2)}>{lead}</p>}
{areaLine && (
<p className="lsh-area lsh-rise" style={rise(2)}>
<MapPin size={16} strokeWidth={2.5} aria-hidden="true" className="lsh-inline-icon" />
{areaLine}
</p>
)}
<div ref={actionsRef} className="lsh-actions lsh-rise" style={rise(3)}>
{question && <p className="lsh-question">{question}</p>}
<div className="lsh-buttons">
{callButton}
{bookButton}
</div>
{reassurance && <p className="lsh-reassure">{reassurance}</p>}
{ps && (
<p className="lsh-ps">
<strong>{psLabel}</strong> {ps}
</p>
)}
</div>
</div>
{(image || trust.length > 0) && (
<div className="lsh-media">
{image && (
<figure className="lsh-photo">
<img src={image} alt={imageAlt} width={1200} height={800} loading="lazy" decoding="async" />
{imageCaption && <figcaption>{imageCaption}</figcaption>}
</figure>
)}
{trust.length > 0 && (
<ul className="lsh-trust">
{trust.map((point, i) => {
const Icon = TRUST_ICONS[point.icon ?? "service"] ?? Wrench;
return (
<li key={i} className="lsh-trust__item">
<span className="lsh-disc" aria-hidden="true">
<Icon size={20} strokeWidth={2.5} />
</span>
<span className="lsh-trust__text">
<strong className="lsh-trust__title">{point.title}</strong>
{point.detail && <span className="lsh-trust__detail">{point.detail}</span>}
</span>
</li>
);
})}
</ul>
)}
</div>
)}
{showForm && (
<aside className="lsh-rail" aria-label={copy.title}>
<div className="lsh-stick">
<div ref={cardRef} className="lsh-card lsh-rise" style={rise(2)} data-open={String(expanded)} onKeyDown={onCardKey}>
<h2 className="lsh-title">
<span className="lsh-title__text">{copy.title}</span>
<button ref={toggleRef} type="button" className="lsh-toggle" aria-expanded={expanded} aria-controls={ids.form} onClick={() => setOpen((o) => !o)}>
<span>{copy.title}</span>
<span className="lsh-toggle__disc" aria-hidden="true">
<ChevronDown size={20} strokeWidth={2.5} className="lsh-chev" />
</span>
</button>
</h2>
{offer && (
<div className="lsh-well">
{offer.valueLabel && <p className="lsh-well__label">{offer.valueLabel}</p>}
<p className="lsh-well__value">
<span className="lsh-num">{offer.value}</span>
{(offer.valueWord ?? "value") && <span className="lsh-well__word">{offer.valueWord ?? "value"}</span>}
</p>
{(offer.but ?? "But you won't pay that.") && <p className="lsh-well__but">{offer.but ?? "But you won't pay that."}</p>}
<p className="lsh-well__today">
<span className="lsh-num lsh-num--today lsh-pop">{offer.price}</span>
{offer.priceNote && <span className="lsh-well__note">{offer.priceNote}</span>}
</p>
</div>
)}
<form id={ids.form} className="lsh-form" noValidate onSubmit={submit}>
<div className="lsh-field">
<label className="lsh-label" htmlFor={ids.service}>{copy.serviceLabel}</label>
<div className="lsh-select">
<select
ref={serviceRef}
id={ids.service}
name="service"
className="lsh-input"
value={values.service}
onChange={update("service")}
disabled={disabled}
required
data-empty={String(!values.service)}
aria-invalid={err.service ? true : undefined}
aria-describedby={err.service ? `${ids.service}-err` : undefined}
>
<option value="" disabled>{copy.servicePlaceholder}</option>
{copy.services.map((s) => (
<option key={s} value={s}>{s}</option>
))}
</select>
<ChevronDown size={20} strokeWidth={2.5} aria-hidden="true" className="lsh-select__icon" />
</div>
{err.service && <ErrorLine id={`${ids.service}-err`} text={err.service} />}
</div>
<div className="lsh-pair">
<div className="lsh-field">
<label className="lsh-label" htmlFor={ids.name}>{copy.nameLabel}</label>
<input
ref={nameRef}
id={ids.name}
name="name"
type="text"
autoComplete="name"
className="lsh-input"
placeholder={copy.namePlaceholder}
value={values.name}
onChange={update("name")}
disabled={disabled}
required
aria-invalid={err.name ? true : undefined}
aria-describedby={err.name ? `${ids.name}-err` : undefined}
/>
{err.name && <ErrorLine id={`${ids.name}-err`} text={err.name} />}
</div>
<div className="lsh-field">
<label className="lsh-label" htmlFor={ids.phone}>{copy.phoneLabel}</label>
<input
ref={phoneRef}
id={ids.phone}
name="phone"
type="tel"
inputMode="tel"
autoComplete="tel"
className="lsh-input"
placeholder={copy.phonePlaceholder}
value={values.phone}
onChange={update("phone")}
disabled={disabled}
required
aria-invalid={err.phone ? true : undefined}
aria-describedby={err.phone ? `${ids.phone}-err` : undefined}
/>
{err.phone && <ErrorLine id={`${ids.phone}-err`} text={err.phone} />}
</div>
</div>
<button type="submit" className="lsh-btn lsh-btn--primary lsh-btn--form" disabled={disabled} aria-busy={busy || undefined}>
{busy ? (
<>
<Loader2 size={20} strokeWidth={2.5} aria-hidden="true" className="lsh-spin" />
<span>{copy.busyLabel}</span>
</>
) : (
copy.submitLabel
)}
</button>
{copy.note && <p className="lsh-note">{copy.note}</p>}
</form>
</div>
{phone && talkLabel && (
<p className="lsh-talk">
{fillNodes(talkLabel, {
phone: (
<a href={disabled ? undefined : tel} role={disabled ? "link" : undefined} aria-disabled={disabled || undefined} onClick={guard(onCall)}>
{phone}
</a>
),
})}
</p>
)}
</div>
</aside>
)}
</div>
{bar}
</section>
);
}
export default LocalServiceHero;
function ErrorLine({ id, text }: { id: string; text: string }) {
return (
<p id={id} className="lsh-error">
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" className="lsh-inline-icon" />
{text}
</p>
);
}
function rise(i: number) {
return { "--i": Math.min(i, 4) } as React.CSSProperties;
}
function fill(template: string, map: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (_, key: string) => map[key] ?? "");
}
function fillNodes(template: string, map: Record<string, React.ReactNode>) {
return template.split(/(\{\w+\})/).map((part, i) => {
const match = /^\{(\w+)\}$/.exec(part);
return <React.Fragment key={i}>{match ? map[match[1]] ?? "" : part}</React.Fragment>;
});
}
function renderHeadline(text: string, mark?: string) {
if (!mark) return text;
const at = text.indexOf(mark);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="lsh-mark">{mark}</span>
{text.slice(at + mark.length)}
</>
);
}
/* Theme notes: the stars are decoration, so they read the accent fill (theme-contract: stars, badges, dots).
The marker keeps the contract's translucent yellow default (documented exception, via --marker).
The phone quote-box toggle is a quiet secondary control: its chevron disc reads the secondary button role tokens. */
const CSS = `
.cf-local-service-hero{--lsh-pt:clamp(56px,8vw,112px);--lsh-pb:clamp(64px,8.5vw,120px);--lsh-gx:clamp(16px,5vw,48px);--lsh-marker:var(--marker,#fae37c);--lsh-star:var(--accent-fill,var(--accent,#2563eb));--lsh-shadow:var(--shadow,oklch(0.22 0.03 260));position:relative;background:var(--surface,#fff);color:var(--ink,#101828);font-family:var(--font-body,system-ui,sans-serif);padding:var(--lsh-pt) var(--lsh-gx) var(--lsh-pb);overflow-x:clip}
.cf-local-service-hero *,.cf-local-service-hero *::before,.cf-local-service-hero *::after{box-sizing:border-box}
.cf-local-service-hero .lsh-wrap{max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,420px);grid-template-rows:auto 1fr;grid-template-areas:'intro rail' 'media rail';column-gap:clamp(32px,5vw,72px);row-gap:48px;align-items:start}
.cf-local-service-hero .lsh-wrap[data-form=false]{max-width:46rem;grid-template-columns:minmax(0,1fr);grid-template-areas:'intro' 'media'}
.cf-local-service-hero .lsh-intro{grid-area:intro;min-width:0}
.cf-local-service-hero .lsh-media{grid-area:media;min-width:0}
.cf-local-service-hero .lsh-rating{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 16px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#475467)}
.cf-local-service-hero .lsh-rating strong{color:var(--ink,#101828);font-weight:800;font-size:1.0625rem}
.cf-local-service-hero .lsh-stars{display:inline-flex;gap:2px}
.cf-local-service-hero .lsh-star{fill:var(--lsh-star);stroke:var(--lsh-star)}
.cf-local-service-hero .lsh-star--empty{fill:none;stroke:var(--muted,#475467)}
.cf-local-service-hero .lsh-h1{margin:0 0 clamp(14px,1.4vw,20px);font-family:var(--font-display,inherit);font-size:clamp(2.5rem,4.6vw,4.25rem);line-height:1.04;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--ink,#101828);text-wrap:balance}
.cf-local-service-hero .lsh-mark{color:var(--field-ink,#101828);background-image:linear-gradient(var(--lsh-marker),var(--lsh-marker));background-repeat:no-repeat;background-size:100% 80%;background-position:0 88%;padding:0 .06em;border-radius:.1em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-local-service-hero .lsh-lead{margin:0 0 16px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
.cf-local-service-hero .lsh-area{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#475467);text-wrap:pretty}
.cf-local-service-hero .lsh-area .lsh-inline-icon{color:var(--accent,#2563eb)}
.cf-local-service-hero .lsh-inline-icon{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-local-service-hero .lsh-actions{margin-top:32px}
.cf-local-service-hero .lsh-question{margin:0 0 16px;font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-wrap:balance}
.cf-local-service-hero .lsh-buttons{display:flex;flex-wrap:wrap;gap:12px}
.cf-local-service-hero .lsh-reassure{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#475467);text-wrap:pretty}
.cf-local-service-hero .lsh-ps{margin:20px 0 0;max-width:60ch;font-size:1.0625rem;line-height:1.5;text-wrap:pretty}
.cf-local-service-hero .lsh-ps strong{font-weight:800}
/* buttons: Belcher recipe on the role tokens */
.cf-local-service-hero .lsh-btn{appearance:none;margin:0;border:0;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:64px;padding:12px 28px;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display,inherit));font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;text-transform:var(--button-case,none);text-align:center;text-decoration:none;text-wrap:balance;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .16s ease,box-shadow .16s ease,background .16s ease,color .16s ease}
.cf-local-service-hero .lsh-btn svg{flex:none}
.cf-local-service-hero .lsh-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px}
.cf-local-service-hero .lsh-btn--primary{--b:var(--button-bg,var(--cta,#d33a2c));--b2:var(--button-bg-2,var(--cta-2,#b52e22));color:var(--button-ink,var(--cta-ink,#fff));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--b) calc(l + .04) c h),oklch(from var(--b2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--b) calc(l - .16) c h),0 1px 2px oklch(from var(--lsh-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--lsh-shadow) l c h / .4))}
.cf-local-service-hero .lsh-btn--primary:hover,.cf-local-service-hero .lsh-btn--primary.is-hover{background:linear-gradient(oklch(from var(--b) calc(l - .01) c h),oklch(from var(--b2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--b) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--b) calc(l - .2) c h),0 1px 2px oklch(from var(--lsh-shadow) l c h / .32),0 12px 20px -8px oklch(from var(--lsh-shadow) l c h / .48);transform:translateY(-1px)}
.cf-local-service-hero .lsh-btn--primary:active,.cf-local-service-hero .lsh-btn--primary.is-active{background:linear-gradient(oklch(from var(--b) calc(l - .05) c h),oklch(from var(--b2) calc(l - .09) c h));box-shadow:inset 0 2px 4px oklch(from var(--b) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--b) calc(l - .16) c h),0 1px 2px oklch(from var(--lsh-shadow) l c h / .3);transform:translateY(1px)}
.cf-local-service-hero .lsh-btn--secondary{--s:var(--button-2-bg,var(--secondary,#e8ebf2));color:var(--button-2-ink,var(--secondary-ink,#101828));background:var(--s);border:1px solid var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / .2)))}
.cf-local-service-hero .lsh-btn--secondary:hover{background:oklch(from var(--s) calc(l - .04) c h);transform:translateY(-1px)}
.cf-local-service-hero .lsh-btn--secondary:active{background:oklch(from var(--s) calc(l - .07) c h);box-shadow:inset 0 2px 3px oklch(from var(--s) calc(l - .2) c h / .5);transform:translateY(1px)}
.cf-local-service-hero .lsh-btn:disabled,.cf-local-service-hero .lsh-btn[aria-disabled=true]{background:var(--secondary,#e8ebf2);color:var(--muted,#475467);text-shadow:none;box-shadow:none;transform:none;cursor:not-allowed}
.cf-local-service-hero .lsh-btn[aria-busy=true]{cursor:progress}
.cf-local-service-hero .lsh-btn--hero{min-height:72px;padding:14px 28px}
.cf-local-service-hero .lsh-btn--form{width:100%;min-height:56px;margin-top:8px}
.cf-local-service-hero .lsh-btn--bar{flex:1 1 0;min-height:56px;padding:8px 16px;font-size:1.0625rem}
/* photo and trust points */
.cf-local-service-hero .lsh-photo{margin:0}
.cf-local-service-hero .lsh-photo img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;object-position:center 40%;border-radius:12px;background:color-mix(in oklch,var(--ink,#101828) 6%,var(--surface,#fff))}
.cf-local-service-hero .lsh-photo figcaption{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.cf-local-service-hero .lsh-trust{list-style:none;margin:32px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:24px}
.cf-local-service-hero .lsh-trust__item{display:flex;flex-direction:column;gap:12px;min-width:0}
.cf-local-service-hero .lsh-disc{display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:var(--accent-fill,var(--accent,#2563eb));color:var(--accent-fill-ink,var(--card,#fff))}
.cf-local-service-hero .lsh-trust__text{display:flex;flex-direction:column;gap:4px}
.cf-local-service-hero .lsh-trust__title{font-family:var(--font-display,inherit);font-size:1.0625rem;line-height:1.25;font-weight:800}
.cf-local-service-hero .lsh-trust__detail{font-size:.9375rem;line-height:1.4;color:var(--muted,#475467);text-wrap:pretty}
/* the offer rail: a flat colour block from the band token, with the quote card overhanging onto the page */
.cf-local-service-hero .lsh-rail{grid-area:rail;align-self:stretch;position:relative;isolation:isolate;min-width:0}
.cf-local-service-hero .lsh-rail::before{content:'';position:absolute;z-index:-1;top:calc(-1 * var(--lsh-pt));bottom:calc(-1 * var(--lsh-pb));left:28%;right:-100vw;background:var(--band,#13233f)}
.cf-local-service-hero .lsh-stick{position:sticky;top:24px}
.cf-local-service-hero .lsh-wrap[data-sticky=false] .lsh-stick{position:static}
.cf-local-service-hero .lsh-card{container-type:inline-size;background:var(--card,#fff);color:var(--ink,#101828);border:1px solid var(--card-border,oklch(from var(--ink,#101828) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));padding:clamp(20px,3vw,32px)}
.cf-local-service-hero .lsh-title{margin:0 0 16px;font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-wrap:balance}
.cf-local-service-hero .lsh-toggle{--lsh-toggle-bg:var(--button-2-bg,var(--secondary,#e8ebf2));--lsh-toggle-ink:var(--button-2-ink,var(--secondary-ink,#101828));display:none;appearance:none;width:100%;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:left;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;border-radius:8px}
.cf-local-service-hero .lsh-toggle:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:4px}
.cf-local-service-hero .lsh-toggle__disc{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:999px;background:var(--lsh-toggle-bg);color:var(--lsh-toggle-ink);border:1px solid var(--button-2-border,transparent)}
.cf-local-service-hero .lsh-card[data-open=true] .lsh-chev{transform:rotate(180deg)}
/* value reveal well */
.cf-local-service-hero .lsh-well{margin:0 0 24px;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#fff))}
.cf-local-service-hero .lsh-well p{margin:0}
.cf-local-service-hero .lsh-well__label{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#475467)}
.cf-local-service-hero .lsh-num{display:inline-block;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:2.5rem;line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-local-service-hero .lsh-well p.lsh-well__value{display:flex;align-items:baseline;flex-wrap:wrap;gap:12px 10px;margin:8px 0 12px}
.cf-local-service-hero .lsh-well__word{font-size:1.0625rem;font-weight:700;color:var(--muted,#475467)}
.cf-local-service-hero .lsh-well__but{font-size:1.0625rem;line-height:1.4;font-weight:700}
.cf-local-service-hero .lsh-well p.lsh-well__today{display:flex;align-items:baseline;flex-wrap:wrap;gap:12px 12px;margin-top:12px}
.cf-local-service-hero .lsh-num--today{color:var(--success,#15803d);font-size:clamp(3rem,4.2vw,3.75rem);transform-origin:left bottom}
.cf-local-service-hero .lsh-well__note{font-size:1.0625rem;line-height:1.4;font-weight:700;text-wrap:pretty}
/* fields */
.cf-local-service-hero .lsh-form{margin:0}
.cf-local-service-hero .lsh-field{margin:0 0 16px;min-width:0}
.cf-local-service-hero .lsh-label{display:block;margin:0 0 8px;font-size:1rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink,#101828))}
.cf-local-service-hero .lsh-input{display:block;width:100%;height:56px;margin:0;padding:0 16px;font-family:var(--font-body,inherit);font-size:1.0625rem;color:var(--field-ink,#101828);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#101828) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));transition:border-color .16s ease,box-shadow .16s ease}
.cf-local-service-hero .lsh-input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#fff));opacity:1}
.cf-local-service-hero .lsh-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink,#101828) 40%,transparent)}
.cf-local-service-hero .lsh-input:focus{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-local-service-hero .lsh-input[aria-invalid=true]{border-color:var(--danger,#b42318)}
.cf-local-service-hero .lsh-input[aria-invalid=true]:focus{box-shadow:0 0 0 3px oklch(from var(--danger,#b42318) l c h / .3)}
.cf-local-service-hero .lsh-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink,#101828) 6%,var(--field,#fff))}
.cf-local-service-hero .lsh-select{position:relative}
.cf-local-service-hero select.lsh-input{appearance:none;-webkit-appearance:none;padding-right:48px;cursor:pointer}
.cf-local-service-hero select.lsh-input[data-empty=true]{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#fff))}
.cf-local-service-hero select.lsh-input option{color:var(--field-ink,#101828);background:var(--field,#fff)}
.cf-local-service-hero .lsh-select__icon{position:absolute;right:16px;top:50%;transform:translateY(-50%);pointer-events:none;color:var(--field-ink,#101828)}
.cf-local-service-hero .lsh-error{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger,#b42318);text-wrap:pretty}
.cf-local-service-hero .lsh-pair{display:grid;grid-template-columns:minmax(0,1fr);column-gap:12px;align-items:start}
@container (min-width:380px){.cf-local-service-hero .lsh-pair{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.cf-local-service-hero .lsh-note{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted,#475467);text-align:center;text-wrap:pretty}
.cf-local-service-hero .lsh-talk{margin:0 0 0 28%;padding:16px 16px 4px;background:var(--band,#13233f);font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--band-ink,#fff);text-align:center;text-wrap:pretty}
.cf-local-service-hero .lsh-talk a{color:var(--band-ink,#fff);font-weight:800;text-decoration:underline;text-decoration-color:oklch(from var(--band-ink,#fff) l c h / .55);text-underline-offset:.18em;border-radius:4px}
.cf-local-service-hero .lsh-talk a:hover{text-decoration-color:var(--band-ink,#fff);text-decoration-thickness:2px}
.cf-local-service-hero .lsh-talk a:focus-visible{outline:3px solid var(--band-ink,#fff);outline-offset:3px}
.cf-local-service-hero .lsh-bar{display:none}
/* phone and tablet: intro, then the quote band, then the photo and trust points */
@media (max-width:959.98px){
.cf-local-service-hero .lsh-wrap{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:'intro' 'rail' 'media';row-gap:0}
.cf-local-service-hero .lsh-wrap[data-form=false]{grid-template-areas:'intro' 'media'}
.cf-local-service-hero .lsh-intro{padding-bottom:40px}
.cf-local-service-hero .lsh-rail{margin-inline:calc(-1 * var(--lsh-gx));padding:32px var(--lsh-gx) 36px;background:var(--band,#13233f)}
.cf-local-service-hero .lsh-rail::before{display:none}
.cf-local-service-hero .lsh-stick{position:static;max-width:560px}
.cf-local-service-hero .lsh-media{padding-top:48px}
.cf-local-service-hero .lsh-wrap[data-form=false] .lsh-media{padding-top:8px}
.cf-local-service-hero .lsh-talk{margin:0;padding:16px 0 0;text-align:center}
.cf-local-service-hero .lsh-title__text{display:none}
.cf-local-service-hero .lsh-toggle{display:flex}
.cf-local-service-hero .lsh-card[data-open=false] .lsh-form{display:none}
.cf-local-service-hero .lsh-card[data-open=false] .lsh-well{margin-bottom:0}
.cf-local-service-hero .lsh-bar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:40;gap:8px;padding:10px var(--lsh-gx) calc(10px + env(safe-area-inset-bottom,0px));background:var(--card,#fff);box-shadow:0 -1px 0 oklch(from var(--lsh-shadow) l c h / .12),0 -8px 16px -8px oklch(from var(--lsh-shadow) l c h / .35);transform:translateY(110%);visibility:hidden;transition:transform .25s cubic-bezier(.2,.7,.2,1),visibility 0s linear .25s}
.cf-local-service-hero .lsh-bar[data-show=true]{transform:none;visibility:visible;transition:transform .25s cubic-bezier(.2,.7,.2,1),visibility 0s}
}
@media (max-width:599.98px){
.cf-local-service-hero .lsh-buttons .lsh-btn--hero{width:100%}
.cf-local-service-hero .lsh-trust{grid-template-columns:minmax(0,1fr);gap:20px}
.cf-local-service-hero .lsh-trust__item{display:grid;grid-template-columns:40px minmax(0,1fr);gap:16px;align-items:start}
.cf-local-service-hero .lsh-stick{max-width:none}
}
/* motion */
@media (prefers-reduced-motion:no-preference){
.cf-local-service-hero .lsh-rise{animation:lsh-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * .07s)}
.cf-local-service-hero .lsh-mark{animation:lsh-mark .6s cubic-bezier(.2,.7,.2,1) .2s both}
.cf-local-service-hero .lsh-pop{animation:lsh-pop .3s cubic-bezier(.2,.7,.2,1) .45s both}
.cf-local-service-hero .lsh-chev{transition:transform .2s ease}
.cf-local-service-hero .lsh-spin{animation:lsh-spin .8s linear infinite}
}
@media (prefers-reduced-motion:reduce){
.cf-local-service-hero .lsh-btn,.cf-local-service-hero .lsh-bar,.cf-local-service-hero .lsh-bar[data-show=true],.cf-local-service-hero .lsh-input{transition:none}
.cf-local-service-hero .lsh-btn:hover,.cf-local-service-hero .lsh-btn:active,.cf-local-service-hero .lsh-btn.is-hover,.cf-local-service-hero .lsh-btn.is-active{transform:none}
}
@keyframes lsh-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes lsh-mark{from{background-size:0% 80%}}
@keyframes lsh-pop{from{opacity:.82;transform:scale(.9)}}
@keyframes lsh-spin{to{transform:rotate(360deg)}}
`;
pieces/hero/local-service-hero/specimen.tsx 56 lines
import __studioImageeec138a2 from "../assets/3f2653a48b839291.webp";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
import { LocalServiceHero, type LocalServiceHeroProps } from "../local-service-hero";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function LocalServiceHeroSpecimen({ state }: { state?: LocalServiceHeroProps["state"] }) {
const guarantee = defaults.sample.guarantee;
return (
<LocalServiceHero
state={state}
rating={{ score: 4.9, count: "1,280" }}
ratingLabel="{score} stars from {count} local reviews"
headline="Plumbing fixed today, anywhere in Austin"
headlineMark="fixed today"
lead="Leaks, clogs and cold showers sorted by a licensed plumber who quotes up front, shows up on time and cleans up after."
areaLine="Serving Austin, Round Rock, Cedar Park and Pflugerville"
question="Water where it shouldn't be?"
phone="(512) 555-0148"
callLabel="Yes, call {phone}"
bookLabel="Book online"
reassurance="A real plumber picks up, 7 days a week"
ps={`Not sure it's worth a call? The quote is free, and every repair is backed by our ${guarantee}.`}
image={slot(
"scene",
__studioImageeec138a2
)}
imageAlt="Plumber standing beside a white service van stocked with parts and tools"
imageCaption="Every van carries the parts for most repairs, so the job gets done on the first visit."
trust={[
{ icon: "licensed", title: "Licensed and insured", detail: "A master plumber on every job, fully insured." },
{ icon: "same-day", title: "Same-day service", detail: "Call before 2pm and we're at your door today." },
{ icon: "guarantee", title: "Fixed or it's free", detail: `Every repair is backed by our ${guarantee}.` },
]}
offer={{
valueLabel: "Whole-home plumbing check",
value: "$129",
valueWord: "value",
but: "But you won't pay that.",
price: "$0",
priceNote: "with any repair you book",
}}
form={{
title: "Get your free quote in 60 seconds",
serviceLabel: "What needs fixing?",
servicePlaceholder: "Choose a problem…",
services: ["Leak or burst pipe", "Clogged drain", "Water heater", "Toilet repair", "Something else"],
phonePlaceholder: "(512) 555-0199",
note: "No obligation. We text your quote, usually within the hour.",
}}
talkLabel="Prefer to talk? Call {phone}"
stickyBar
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalLocalServiceHero |
string |
|
headlineMark OptionalLocalServiceHero |
string |
|
lead OptionalLocalServiceHero |
string |
|
areaLine OptionalLocalServiceHero |
string |
|
rating OptionalLocalServiceHero |
{ score: number; count?: string } |
|
ratingLabel OptionalLocalServiceHero |
string |
|
ratingLabelNoCount OptionalLocalServiceHero |
string |
|
question OptionalLocalServiceHero |
string |
|
phone OptionalLocalServiceHero |
string |
|
phoneHref OptionalLocalServiceHero |
string |
|
callLabel OptionalLocalServiceHero |
string |
|
onCall OptionalLocalServiceHero |
() => void |
|
bookLabel OptionalLocalServiceHero |
string |
|
bookHref OptionalLocalServiceHero |
string |
|
onBook OptionalLocalServiceHero |
() => void |
|
reassurance OptionalLocalServiceHero |
string |
|
psLabel OptionalLocalServiceHero |
string |
|
ps OptionalLocalServiceHero |
string |
|
image OptionalLocalServiceHero |
string |
|
imageAlt OptionalLocalServiceHero |
string |
|
imageCaption OptionalLocalServiceHero |
string |
|
trust OptionalLocalServiceHero |
LocalServiceTrustPoint[] |
|
showForm OptionalLocalServiceHero |
boolean |
|
defaultFormOpen OptionalLocalServiceHero |
boolean |
|
form OptionalLocalServiceHero |
Partial<LocalServiceQuoteCopy> |
|
offer OptionalLocalServiceHero |
LocalServiceOffer |
|
onSubmit OptionalLocalServiceHero |
(values: LocalServiceQuoteValues) => void |
|
busy OptionalLocalServiceHero |
boolean |
|
talkLabel OptionalLocalServiceHero |
string |
|
stickyOffer OptionalLocalServiceHero |
boolean |
|
stickyBar OptionalLocalServiceHero |
boolean |
|
barCallLabel OptionalLocalServiceHero |
string |
|
barQuoteLabel OptionalLocalServiceHero |
string |
|
barLabel OptionalLocalServiceHero |
string |
|
state OptionalLocalServiceHero |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalLocalServiceHero |
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.
-
3f2653a48b839291.webp
image/webp · 133 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB