Local Business Header 1
Local business header: a slim hello strip with today's hours, the service area and the supplied rating; tap-to-call and the free-quote action always one tap away.
Use it in a prompt
Use nav/local-business-header from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/nav/local-business-header.tsx. - Import it and pass your copy and images (Props tab):
import { LocalBusinessHeader } from "@/components/funneldna/nav/local-business-header"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/nav/local-business-header/component.tsx 1026 lines
// layout: hello-strip
// Local business header: a slim hello strip with today's hours, the service area and the supplied rating; tap-to-call and the free-quote action always one tap away.
import React from "react";
import { ChevronDown, MapPin, Menu, Phone, ShieldCheck, Star, X } from "lucide-react";
export type ServiceLink = {
label: string;
/** One benefit line under the service name. */
detail?: string;
href: string;
};
export type NavLink = { label: string; href: string };
export type BusinessRating = {
/** The supplied score, e.g. "4.9". */
score: string;
/** The supplied review count, e.g. "212". */
count?: string;
/** Where the reviews live, e.g. "Google". */
source?: string;
/** Link to the reviews section or page. */
href?: string;
/** Scale the score is out of (default 5); also the number of stars drawn. */
outOf?: number;
};
export type LocalBusinessHeaderCopy = {
/** Accessible name of the desktop navigation landmark. */
navLabel: string;
/** Accessible label of the menu toggle while the sheet is closed. */
menuOpen: string;
/** Accessible label of the menu toggle while the sheet is open. */
menuClose: string;
/** {score}, {count}, {source}, {outOf} are replaced. */
ratingLabel: string;
/** Used when no count is supplied. {score}, {outOf} are replaced. */
ratingScoreOnly: string;
/** Screen-reader word read before the phone number. */
callSr: string;
/** Help line at the foot of the services dropdown. */
servicesHelp: string;
/** {phone} is replaced. */
servicesHelpAction: string;
/** Heading at the top of the tablet/phone menu sheet. */
sheetTitle: string;
};
export type LocalBusinessHeaderProps = {
businessName?: string;
/** Slot "logo": a transparent logo mark shown beside the name. */
logoImage?: string;
/** Alt text for the logo; empty (decorative) by default since the name sits beside it. */
logoAlt?: string;
/** Destination of the logo/name link. */
homeHref?: string;
/** One short promise line under the business name. */
tagline?: string;
/** A phrase inside the tagline swiped with the marker highlight. */
taglineHighlight?: string;
/** Bold lead-in before the hours, e.g. "Open today". */
hoursLabel?: string;
hours?: string;
/** Shows the green open dot when true. */
isOpen?: boolean;
serviceArea?: string;
/** Makes the service area in the strip a link. */
serviceAreaHref?: string;
/** Only shown when supplied. */
guarantee?: string;
/** Displayed phone number; also builds the tel: link. */
phone?: string;
/** Defaults to a tel: link built from the phone number. */
phoneHref?: string;
/** Phone-layout call button label. */
callLabel?: string;
/** Desktop primary action label. */
ctaLabel?: string;
/** Phone-layout action label. */
ctaShortLabel?: string;
/** Primary action destination; without it the action is a button. */
href?: string;
/** Primary action click. */
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
/** Any tap-to-call link click. */
onCall?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
/** Label of the services dropdown trigger. */
servicesLabel?: string;
/** Services in the dropdown and the menu sheet; an empty list hides the dropdown. */
services?: ServiceLink[];
/** Plain nav links after the services dropdown. */
links?: NavLink[];
/** Supplied rating only; nothing renders without it. */
rating?: BusinessRating;
/** Sticks to the top of the viewport and compacts on phones when scrolled. */
sticky?: boolean;
/** Primary action state. */
state?: "default" | "hover" | "active" | "disabled";
/** Fixed interface copy; any key overrides its default. */
copy?: Partial<LocalBusinessHeaderCopy>;
className?: string;
};
const DEFAULT_COPY: LocalBusinessHeaderCopy = {
navLabel: "Main",
menuOpen: "Open menu",
menuClose: "Close menu",
ratingLabel: "{score} from {count} {source} reviews",
ratingScoreOnly: "{score} out of {outOf}",
callSr: "Call",
servicesHelp: "Not sure which service you need?",
servicesHelpAction: "Call {phone}",
sheetTitle: "How can we help today?",
};
const DEFAULT_SERVICES: ServiceLink[] = [
{ label: "Repairs", detail: "Diagnose it and fix it in one visit", href: "#services" },
{ label: "Installations", detail: "New equipment, fitted properly", href: "#services" },
{ label: "Maintenance", detail: "Keep it running all year", href: "#services" },
{ label: "Inspections", detail: "Know exactly where you stand", href: "#services" },
];
const DEFAULT_LINKS: NavLink[] = [
{ label: "Reviews", href: "#reviews" },
{ label: "Service area", href: "#area" },
];
/** Scroll depth that compacts the sticky header, and the lower point that restores it (hysteresis). */
const COMPACT_AT = 140;
const RESTORE_AT = 24;
export function LocalBusinessHeader(props: LocalBusinessHeaderProps) {
const {
businessName = "Brightline Home Services",
logoImage,
logoAlt,
homeHref = "/",
tagline = "Same-day repairs with upfront prices.",
taglineHighlight = "upfront prices",
hoursLabel = "Open today",
hours = "8:00am – 6:00pm",
isOpen = true,
serviceArea = "Serving the greater metro area",
serviceAreaHref,
guarantee = "",
phone = "(555) 010-0142",
phoneHref,
callLabel = "Call now",
ctaLabel = "Get my free quote",
ctaShortLabel = "Free quote",
href,
onAction,
onCall,
servicesLabel = "Services",
services = DEFAULT_SERVICES,
links = DEFAULT_LINKS,
rating,
sticky = false,
state = "default",
copy: copyProp,
className,
} = props;
const copy = { ...DEFAULT_COPY, ...copyProp };
const tel = phoneHref ?? `tel:${phone.replace(/[^\d+]/g, "")}`;
const uid = React.useId().replace(/:/g, "");
const ddId = `lbh-services-${uid}`;
const sheetId = `lbh-sheet-${uid}`;
const [open, setOpen] = React.useState<null | "services" | "menu">(null);
const [scrolled, setScrolled] = React.useState(false);
const rootRef = React.useRef<HTMLElement>(null);
const zoneRef = React.useRef<HTMLLIElement>(null);
const servicesBtnRef = React.useRef<HTMLButtonElement>(null);
const menuBtnRef = React.useRef<HTMLButtonElement>(null);
const sheetRef = React.useRef<HTMLDivElement>(null);
React.useEffect(() => {
if (!sticky || typeof window === "undefined") return;
const onScroll = () => {
const y = window.scrollY;
setScrolled((prev) => (prev ? y > RESTORE_AT : y > COMPACT_AT));
};
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, [sticky]);
React.useEffect(() => {
if (!open) return;
const onKey = (event: KeyboardEvent) => {
if (event.key !== "Escape") return;
const which = open;
setOpen(null);
(which === "services" ? servicesBtnRef : menuBtnRef).current?.focus();
};
const onDown = (event: PointerEvent) => {
const zone = open === "services" ? zoneRef.current : rootRef.current;
if (zone && !zone.contains(event.target as Node)) setOpen(null);
};
document.addEventListener("keydown", onKey);
document.addEventListener("pointerdown", onDown);
return () => {
document.removeEventListener("keydown", onKey);
document.removeEventListener("pointerdown", onDown);
};
}, [open]);
React.useEffect(() => {
if (open === "menu") sheetRef.current?.querySelector<HTMLElement>("a, button")?.focus();
}, [open]);
const close = () => setOpen(null);
const disabled = state === "disabled";
const ctaClass = `lbh-btn lbh-cta${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-active" : ""}`;
const renderCta = (label: string) =>
href && !disabled ? (
<a className={ctaClass} href={href} onClick={onAction}>
{label}
</a>
) : (
<button type="button" className={ctaClass} disabled={disabled} onClick={onAction}>
{label}
</button>
);
const renderRating = () => {
if (!rating) return null;
const ratingValue = parseFloat(rating.score);
const outOf = rating.outOf ?? 5;
const template = rating.count ? copy.ratingLabel : copy.ratingScoreOnly;
const [beforeRaw, ...rest] = template.split("{score}");
const vars = { count: rating.count, source: rating.source, outOf };
const before = fill(beforeRaw, vars);
const after = fill(rest.join(rating.score), vars);
const inner = (
<>
{Number.isFinite(ratingValue) && <Stars value={ratingValue} outOf={outOf} />}
{before && <>{before} </>}
<strong>{rating.score}</strong>
{after && <> {after}</>}
</>
);
return rating.href ? (
<a className="lbh-rating lbh-link" href={rating.href}>
{inner}
</a>
) : (
<span className="lbh-rating">{inner}</span>
);
};
const serviceItems = services.map((service) => (
<li key={service.label}>
<a className="lbh-svc" href={service.href} onClick={close}>
<span className="lbh-svc-name">{service.label}</span>
{service.detail && <span className="lbh-svc-detail">{service.detail}</span>}
</a>
</li>
));
const rootClass = [
"cf-local-business-header",
sticky ? "is-sticky" : "",
scrolled ? "is-scrolled" : "",
className ?? "",
]
.filter(Boolean)
.join(" ");
return (
<header ref={rootRef} className={rootClass} data-state={state}>
<style>{CSS}</style>
<div className="lbh-strip">
<div className="lbh-strip-inner">
<ul className="lbh-facts">
<li className="lbh-fact">
<span className={`lbh-dot${isOpen ? "" : " is-closed"}`} aria-hidden="true" />
<strong>{hoursLabel}</strong> {hours}
</li>
{serviceArea && (
<li className="lbh-fact">
<MapPin size={16} strokeWidth={2.5} aria-hidden="true" />
{serviceAreaHref ? (
<a className="lbh-link" href={serviceAreaHref}>
{serviceArea}
</a>
) : (
serviceArea
)}
</li>
)}
{rating && <li className="lbh-fact lbh-fact-rating">{renderRating()}</li>}
</ul>
{guarantee && (
<p className="lbh-guarantee">
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden="true" />
{guarantee}
</p>
)}
</div>
</div>
<div className="lbh-main">
<div className="lbh-main-inner">
<a className="lbh-brand" href={homeHref}>
{logoImage && <img className="lbh-logo" src={logoImage} alt={logoAlt ?? ""} width={52} height={52} />}
<span className="lbh-brand-text">
<span className="lbh-name">{businessName}</span>
{tagline && <span className="lbh-tagline">{withHighlight(tagline, taglineHighlight)}</span>}
</span>
</a>
<nav className="lbh-nav" aria-label={copy.navLabel}>
<ul className="lbh-nav-list">
{services.length > 0 && (
<li
className="lbh-dd"
ref={zoneRef}
onBlur={(event: React.FocusEvent<HTMLLIElement>) => {
const next = event.relatedTarget as Node | null;
if (next && !event.currentTarget.contains(next)) {
setOpen((o) => (o === "services" ? null : o));
}
}}
>
<button
ref={servicesBtnRef}
type="button"
className="lbh-nav-link"
aria-expanded={open === "services"}
aria-controls={ddId}
onClick={() => setOpen((o) => (o === "services" ? null : "services"))}
>
{servicesLabel}
<ChevronDown size={18} strokeWidth={2.5} aria-hidden="true" />
</button>
<div id={ddId} className="lbh-dd-panel" hidden={open !== "services"}>
<ul className="lbh-svc-grid">{serviceItems}</ul>
<div className="lbh-help">
<span>{copy.servicesHelp}</span>
<a className="lbh-help-link" href={tel} onClick={onCall}>
<Phone size={16} strokeWidth={2.5} aria-hidden="true" />
{fill(copy.servicesHelpAction, { phone })}
</a>
</div>
</div>
</li>
)}
{links.map((link) => (
<li key={link.label}>
<a className="lbh-nav-link" href={link.href}>
{link.label}
</a>
</li>
))}
</ul>
</nav>
<div className="lbh-actions">
<a className="lbh-btn lbh-call" href={tel} onClick={onCall}>
<Phone size={20} strokeWidth={2.5} aria-hidden="true" />
<span className="lbh-sr">{copy.callSr} </span>
{phone}
</a>
{renderCta(ctaLabel)}
</div>
<button
ref={menuBtnRef}
type="button"
className="lbh-toggle"
aria-expanded={open === "menu"}
aria-controls={sheetId}
aria-label={open === "menu" ? copy.menuClose : copy.menuOpen}
onClick={() => setOpen((o) => (o === "menu" ? null : "menu"))}
>
{open === "menu" ? (
<X size={24} strokeWidth={2.5} aria-hidden="true" />
) : (
<Menu size={24} strokeWidth={2.5} aria-hidden="true" />
)}
</button>
<div className="lbh-mobile-actions">
<a className="lbh-btn lbh-call" href={tel} onClick={onCall}>
<Phone size={20} strokeWidth={2.5} aria-hidden="true" />
{callLabel}
<span className="lbh-sr"> {phone}</span>
</a>
{renderCta(ctaShortLabel)}
</div>
{rating && <p className="lbh-mobile-proof">{renderRating()}</p>}
</div>
<div id={sheetId} ref={sheetRef} className="lbh-sheet" hidden={open !== "menu"}>
<div className="lbh-sheet-inner">
<p className="lbh-sheet-title">{copy.sheetTitle}</p>
{services.length > 0 && <ul className="lbh-sheet-svc">{serviceItems}</ul>}
{links.length > 0 && (
<ul className="lbh-sheet-links">
{links.map((link) => (
<li key={link.label}>
<a className="lbh-sheet-link" href={link.href} onClick={close}>
{link.label}
</a>
</li>
))}
</ul>
)}
<div className="lbh-sheet-info">
<p>
<span className={`lbh-dot${isOpen ? "" : " is-closed"}`} aria-hidden="true" />
<strong>{hoursLabel}</strong> {hours}
</p>
{serviceArea && (
<p>
<MapPin size={18} strokeWidth={2.5} aria-hidden="true" />
{serviceArea}
</p>
)}
{guarantee && (
<p>
<ShieldCheck size={18} strokeWidth={2.5} aria-hidden="true" />
{guarantee}
</p>
)}
</div>
</div>
</div>
</div>
</header>
);
}
export default LocalBusinessHeader;
/** Replaces {name} placeholders as plain text, collapsing the gaps an empty value leaves. */
function fill(template: string, vars: Record<string, string | number | undefined>) {
return template
.replace(/\{(\w+)\}/g, (_, key: string) => String(vars[key] ?? ""))
.replace(/\s{2,}/g, " ")
.trim();
}
/** Wraps the first occurrence of the phrase in one marker stroke. */
function withHighlight(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<mark className="lbh-mark">{phrase}</mark>
{text.slice(at + phrase.length)}
</>
);
}
/** Decorative stars; each fills to the exact fraction of the supplied score. */
function Stars({ value, outOf }: { value: number; outOf: number }) {
return (
<span className="lbh-stars" aria-hidden="true">
{Array.from({ length: outOf }, (_, i) => {
const part = Math.max(0, Math.min(1, value - i));
return (
<span className="lbh-star" key={i}>
<Star className="lbh-star-base" size={16} strokeWidth={2.5} />
<span className="lbh-star-fill" style={{ width: `${part * 100}%` }}>
<Star size={16} strokeWidth={2.5} />
</span>
</span>
);
})}
</span>
);
}
const CSS = `
.cf-local-business-header{
--lbh-gutter: clamp(16px, 5vw, 48px);
--lbh-max: 1320px;
--lbh-shadow: var(--shadow, oklch(0.22 0.03 260));
--lbh-focus: var(--field-focus, var(--accent, #2563eb));
--lbh-marker: oklch(from var(--highlight-marker, var(--marker, #fae37c)) l c h / 0.72);
/* Stars are decoration: the brand's accent exactly as supplied (--accent-fill), with a deeper edge of the same hue. */
--lbh-star: var(--star-fill, var(--accent-fill, var(--accent, #2563eb)));
--lbh-star-edge: var(--star-edge, oklch(from var(--accent-fill, var(--accent, #2563eb)) calc(l - 0.12) c h));
position: relative;
z-index: 40;
width: 100%;
font-family: var(--font-body, system-ui, sans-serif);
color: var(--ink, #101828);
background: var(--surface, #ffffff);
}
.cf-local-business-header *,
.cf-local-business-header *::before,
.cf-local-business-header *::after{ box-sizing: border-box; }
.cf-local-business-header.is-sticky{ position: sticky; top: 0; }
.cf-local-business-header .lbh-sr{
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.cf-local-business-header a:focus-visible,
.cf-local-business-header button:focus-visible{
outline: 3px solid var(--lbh-focus);
outline-offset: 3px;
}
/* Hello strip */
.cf-local-business-header .lbh-strip{
background: var(--band, #13294b);
color: var(--band-ink, #ffffff);
}
.cf-local-business-header .lbh-strip a:focus-visible{ outline-color: var(--band-ink, #ffffff); }
.cf-local-business-header .lbh-strip-inner{
max-width: var(--lbh-max);
margin: 0 auto;
padding: 10px var(--lbh-gutter);
min-height: 44px;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px 24px;
font-size: 0.9375rem;
line-height: 1.4;
font-weight: 600;
}
.cf-local-business-header .lbh-facts{
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px 24px;
margin: 0;
padding: 0;
list-style: none;
}
.cf-local-business-header .lbh-fact{ white-space: nowrap; }
.cf-local-business-header .lbh-fact strong{ font-weight: 800; }
.cf-local-business-header .lbh-fact > svg,
.cf-local-business-header .lbh-guarantee > svg{
display: inline-block;
vertical-align: -0.18em;
margin-inline-end: 0.4em;
}
.cf-local-business-header .lbh-dot{
display: inline-block;
width: 10px;
height: 10px;
border-radius: 999px;
background: var(--success, #16a34a);
margin-inline-end: 0.55em;
vertical-align: 0.02em;
}
.cf-local-business-header .lbh-strip .lbh-dot.is-closed{ background: oklch(from var(--band-ink, #ffffff) l c h / 0.5); }
.cf-local-business-header .lbh-guarantee{ margin: 0; white-space: nowrap; }
.cf-local-business-header .lbh-link{
color: var(--link, var(--accent, #2563eb));
text-decoration: underline;
text-decoration-color: oklch(from var(--link, var(--accent, #2563eb)) l c h / 0.45);
text-underline-offset: 0.18em;
text-decoration-thickness: 1px;
border-radius: 4px;
}
.cf-local-business-header .lbh-link:hover{
color: oklch(from var(--link, var(--accent, #2563eb)) calc(l - 0.08) c h);
text-decoration-color: currentColor;
}
.cf-local-business-header .lbh-strip .lbh-link{
color: var(--band-ink, #ffffff);
text-decoration-color: oklch(from var(--band-ink, #ffffff) l c h / 0.45);
}
.cf-local-business-header .lbh-strip .lbh-link:hover{
color: var(--band-ink, #ffffff);
text-decoration-color: currentColor;
}
.cf-local-business-header .lbh-rating strong{ font-weight: 800; }
/* Stars: partial fill shows the supplied score exactly */
.cf-local-business-header .lbh-stars{
display: inline-flex;
gap: 2px;
vertical-align: -0.16em;
margin-inline-end: 0.5em;
}
.cf-local-business-header .lbh-star{ position: relative; display: inline-block; width: 16px; height: 16px; }
.cf-local-business-header .lbh-star svg{ display: block; width: 16px; height: 16px; max-width: none; flex: none; }
.cf-local-business-header .lbh-star-base{ color: oklch(from var(--band-ink, #ffffff) l c h / 0.4); }
.cf-local-business-header .lbh-star-fill{ position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; }
.cf-local-business-header .lbh-star-fill svg{ color: var(--lbh-star-edge); fill: var(--lbh-star); }
/* Main bar */
.cf-local-business-header .lbh-main{
position: relative;
background: var(--surface, #ffffff);
border-bottom: 1px solid oklch(from var(--ink, #101828) l c h / 0.1);
transition: box-shadow 0.16s ease;
}
.cf-local-business-header.is-scrolled .lbh-main{
box-shadow: var(--shadow-md, 0 1px 2px oklch(from var(--lbh-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--lbh-shadow) l c h / 0.2));
}
.cf-local-business-header .lbh-main-inner{
max-width: var(--lbh-max);
margin: 0 auto;
padding: 16px var(--lbh-gutter);
min-height: 88px;
display: flex;
align-items: center;
gap: 24px;
}
.cf-local-business-header .lbh-brand{
display: flex;
align-items: center;
gap: 12px;
min-width: 0;
margin-inline-end: auto;
color: inherit;
text-decoration: none;
border-radius: 8px;
}
.cf-local-business-header .lbh-logo{
width: 52px;
height: 52px;
object-fit: contain;
flex: none;
filter: drop-shadow(0 1px 2px oklch(from var(--lbh-shadow) l c h / 0.25));
}
.cf-local-business-header .lbh-brand-text{ display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf-local-business-header .lbh-name{
font-family: var(--font-display, var(--font-body, system-ui, sans-serif));
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.01em);
text-transform: var(--display-case, none);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
color: var(--ink, #101828);
text-wrap: balance;
}
.cf-local-business-header .lbh-tagline{
font-size: 0.9375rem;
line-height: 1.4;
font-weight: 600;
color: var(--ink, #101828);
text-wrap: pretty;
}
.cf-local-business-header .lbh-mark{
color: inherit;
background-color: transparent;
background-image: linear-gradient(to bottom, transparent 40%, var(--lbh-marker) 40%, var(--lbh-marker) 94%, transparent 94%);
padding: 0 0.22em;
margin: 0 -0.08em;
border-radius: 0.2em 0.45em 0.3em 0.5em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
white-space: nowrap;
}
/* Desktop nav: quiet ghost buttons; the hover tint reads the secondary-button ink so a theme's secondary role reaches them. */
.cf-local-business-header .lbh-nav{ display: flex; align-items: center; }
.cf-local-business-header .lbh-nav-list{ display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cf-local-business-header .lbh-nav-link{
--lbh-nav-hover: color-mix(in oklch, var(--button-2-ink, var(--secondary-ink, var(--ink, #101828))) 6%, var(--surface, #ffffff));
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 44px;
padding: 0 12px;
border: 0;
border-radius: 10px;
background: transparent;
color: var(--ink, #101828);
font-family: var(--font-body, system-ui, sans-serif);
font-size: 1.0625rem;
font-weight: 700;
line-height: 1.2;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
transition: background-color 0.16s ease;
}
.cf-local-business-header .lbh-nav-link:hover,
.cf-local-business-header .lbh-nav-link[aria-expanded="true"]{
background: var(--lbh-nav-hover);
}
.cf-local-business-header .lbh-nav-link svg{ transition: transform 0.16s ease; }
.cf-local-business-header .lbh-nav-link[aria-expanded="true"] svg{ transform: rotate(180deg); }
.cf-local-business-header .lbh-dd{ position: relative; }
.cf-local-business-header .lbh-dd-panel{
position: absolute;
top: calc(100% + 12px);
left: 50%;
transform: translateX(-50%);
width: min(560px, calc(100vw - 32px));
padding: 12px;
background: var(--card, #ffffff);
border: 1px solid var(--card-border, oklch(from var(--ink, #101828) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--lbh-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--lbh-shadow) l c h / 0.32)));
z-index: 50;
animation: lbh-pop 0.2s cubic-bezier(.2,.7,.2,1) both;
}
.cf-local-business-header .lbh-dd-panel[hidden],
.cf-local-business-header .lbh-sheet[hidden]{ display: none; }
@keyframes lbh-pop{
from{ opacity: 0; transform: translate(-50%, 6px); }
to{ opacity: 1; transform: translate(-50%, 0); }
}
.cf-local-business-header .lbh-svc-grid{
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px;
margin: 0;
padding: 0;
list-style: none;
}
.cf-local-business-header .lbh-svc{
display: flex;
flex-direction: column;
gap: 4px;
padding: 12px 14px;
border-radius: 10px;
color: var(--ink, #101828);
text-decoration: none;
transition: background-color 0.16s ease;
}
.cf-local-business-header .lbh-svc:hover{ background: color-mix(in oklch, var(--ink, #101828) 5%, var(--card, #ffffff)); }
.cf-local-business-header .lbh-svc-name{ font-size: 1.0625rem; font-weight: 700; line-height: 1.25; }
.cf-local-business-header .lbh-svc-detail{ font-size: 0.9375rem; line-height: 1.4; color: var(--muted, #475467); text-wrap: pretty; }
.cf-local-business-header .lbh-help{
margin-top: 8px;
padding: 14px 16px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, #101828) 4%, var(--card, #ffffff));
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px 16px;
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--ink, #101828);
}
.cf-local-business-header .lbh-help-link{
color: var(--link, var(--accent, #2563eb));
font-weight: 800;
text-decoration: underline;
text-decoration-color: oklch(from var(--link, var(--accent, #2563eb)) l c h / 0.45);
text-underline-offset: 0.18em;
white-space: nowrap;
font-variant-numeric: tabular-nums;
border-radius: 4px;
}
.cf-local-business-header .lbh-help-link:hover{
color: oklch(from var(--link, var(--accent, #2563eb)) calc(l - 0.08) c h);
text-decoration-color: currentColor;
}
.cf-local-business-header .lbh-help-link svg{ display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
/* Buttons */
.cf-local-business-header .lbh-actions{ display: flex; align-items: center; gap: 12px; flex: none; }
.cf-local-business-header .lbh-btn{
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 56px;
padding: 0 24px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display, var(--font-body, system-ui, sans-serif)));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: 1.125rem;
line-height: 1.15;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-local-business-header .lbh-cta{
--lbh-bg: var(--button-bg, var(--cta, #d92d20));
--lbh-bg2: var(--button-bg-2, var(--cta-2, #b42318));
color: var(--button-ink, var(--cta-ink, #ffffff));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--lbh-bg) calc(l + 0.04) c h), oklch(from var(--lbh-bg2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--lbh-bg) calc(l + 0.14) c h / 0.7),
inset 0 -3px 0 oklch(from var(--lbh-bg) calc(l - 0.16) c h),
0 1px 2px oklch(from var(--lbh-shadow) l c h / 0.3),
0 8px 16px -6px oklch(from var(--lbh-shadow) l c h / 0.45));
}
.cf-local-business-header .lbh-cta.is-hover{
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--lbh-bg) calc(l - 0.01) c h), oklch(from var(--lbh-bg2) calc(l - 0.07) c h));
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--lbh-bg) calc(l + 0.12) c h / 0.7),
inset 0 -3px 0 oklch(from var(--lbh-bg) calc(l - 0.2) c h),
0 1px 2px oklch(from var(--lbh-shadow) l c h / 0.32),
0 10px 18px -6px oklch(from var(--lbh-shadow) l c h / 0.55));
}
@media (hover: hover){
.cf-local-business-header .lbh-cta:not(:disabled):hover{
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--lbh-bg) calc(l - 0.01) c h), oklch(from var(--lbh-bg2) calc(l - 0.07) c h));
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--lbh-bg) calc(l + 0.12) c h / 0.7),
inset 0 -3px 0 oklch(from var(--lbh-bg) calc(l - 0.2) c h),
0 1px 2px oklch(from var(--lbh-shadow) l c h / 0.32),
0 10px 18px -6px oklch(from var(--lbh-shadow) l c h / 0.55));
}
}
.cf-local-business-header .lbh-cta.is-active,
.cf-local-business-header .lbh-cta:not(:disabled):active{
transform: translateY(1px);
background: linear-gradient(oklch(from var(--lbh-bg) calc(l - 0.05) c h), oklch(from var(--lbh-bg2) calc(l - 0.08) c h));
box-shadow:
inset 0 2px 3px oklch(from var(--lbh-bg) calc(l - 0.22) c h / 0.55),
inset 0 -2px 0 oklch(from var(--lbh-bg) calc(l - 0.16) c h),
0 1px 1px oklch(from var(--lbh-shadow) l c h / 0.3);
}
.cf-local-business-header .lbh-cta:disabled{
cursor: not-allowed;
transform: none;
color: var(--secondary-ink, #101828);
background: var(--secondary, #e8ecf3);
text-shadow: none;
box-shadow: inset 0 0 0 1px oklch(from var(--ink, #101828) l c h / 0.12);
}
.cf-local-business-header .lbh-call{
--lbh-b2: var(--button-2-bg, var(--secondary, #e8ecf3));
color: var(--button-2-ink, var(--secondary-ink, #101828));
background: linear-gradient(oklch(from var(--lbh-b2) calc(l + 0.02) c h), oklch(from var(--lbh-b2) calc(l - 0.02) c h));
border: 1px solid var(--button-2-border, transparent);
box-shadow: var(--button-2-shadow,
inset 0 -2px 0 oklch(from var(--lbh-b2) calc(l - 0.1) c h),
var(--shadow-sm, 0 1px 2px oklch(from var(--lbh-shadow) l c h / 0.2)));
font-variant-numeric: tabular-nums;
}
.cf-local-business-header .lbh-call svg{ color: var(--accent, #2563eb); flex: none; }
@media (hover: hover){
.cf-local-business-header .lbh-call:hover{
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--lbh-b2) calc(l - 0.01) c h), oklch(from var(--lbh-b2) calc(l - 0.05) c h));
}
}
.cf-local-business-header .lbh-call:active{
transform: translateY(1px);
box-shadow: inset 0 2px 3px oklch(from var(--lbh-b2) calc(l - 0.2) c h / 0.5);
}
/* Menu toggle */
.cf-local-business-header .lbh-toggle{
display: none;
align-items: center;
justify-content: center;
flex: none;
width: 48px;
height: 48px;
padding: 0;
border: 1px solid oklch(from var(--ink, #101828) l c h / 0.12);
border-radius: var(--button-radius, var(--radius, 12px));
background: color-mix(in oklch, var(--ink, #101828) 4%, var(--surface, #ffffff));
color: var(--ink, #101828);
cursor: pointer;
transition: background-color 0.16s ease;
}
.cf-local-business-header .lbh-toggle:hover,
.cf-local-business-header .lbh-toggle[aria-expanded="true"]{
background: color-mix(in oklch, var(--ink, #101828) 9%, var(--surface, #ffffff));
}
.cf-local-business-header .lbh-mobile-actions,
.cf-local-business-header .lbh-mobile-proof{ display: none; }
/* Menu sheet (tablet and phone) */
.cf-local-business-header .lbh-sheet{
position: absolute;
left: 0;
right: 0;
top: 100%;
max-height: calc(100dvh - 120px);
overflow: auto;
background: var(--card, #ffffff);
border-bottom: 1px solid var(--card-border, oklch(from var(--ink, #101828) l c h / 0.12));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--lbh-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--lbh-shadow) l c h / 0.32)));
animation: lbh-drop 0.22s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes lbh-drop{
from{ opacity: 0; transform: translateY(-6px); }
to{ opacity: 1; transform: translateY(0); }
}
.cf-local-business-header .lbh-sheet-inner{
max-width: var(--lbh-max);
margin: 0 auto;
padding: 24px var(--lbh-gutter) 32px;
display: flex;
flex-direction: column;
gap: 16px;
}
.cf-local-business-header .lbh-sheet-title{
margin: 0;
font-family: var(--font-display, var(--font-body, system-ui, sans-serif));
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.01em);
text-transform: var(--display-case, none);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
text-wrap: balance;
color: var(--ink, #101828);
}
.cf-local-business-header .lbh-sheet-svc{
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4px;
margin: 0 -14px;
padding: 0;
list-style: none;
}
.cf-local-business-header .lbh-sheet-links{ margin: 0; padding: 0; list-style: none; }
.cf-local-business-header .lbh-sheet-links li{ border-top: 1px solid oklch(from var(--ink, #101828) l c h / 0.1); }
.cf-local-business-header .lbh-sheet-link{
display: flex;
align-items: center;
min-height: 52px;
color: var(--ink, #101828);
font-size: 1.0625rem;
font-weight: 700;
text-decoration: none;
border-radius: 8px;
}
.cf-local-business-header .lbh-sheet-link:hover{ color: var(--link, var(--accent, #2563eb)); }
.cf-local-business-header .lbh-sheet-info{
display: flex;
flex-direction: column;
gap: 10px;
padding: 16px 18px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, #101828) 4%, var(--card, #ffffff));
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--ink, #101828);
}
.cf-local-business-header .lbh-sheet-info p{ margin: 0; text-wrap: pretty; }
.cf-local-business-header .lbh-sheet-info strong{ font-weight: 800; }
.cf-local-business-header .lbh-sheet-info svg{ display: inline-block; vertical-align: -0.2em; margin-inline-end: 0.45em; color: var(--accent, #2563eb); }
.cf-local-business-header .lbh-sheet-info .lbh-dot.is-closed{ background: oklch(from var(--ink, #101828) l c h / 0.35); }
@media (min-width: 1280px){
.cf-local-business-header .lbh-sheet{ display: none; }
}
@media (max-width: 1279px){
.cf-local-business-header .lbh-guarantee{ display: none; }
.cf-local-business-header .lbh-nav{ display: none; }
.cf-local-business-header .lbh-toggle{ display: inline-flex; }
.cf-local-business-header .lbh-main-inner{ gap: 16px; }
.cf-local-business-header .lbh-strip-inner{ justify-content: center; text-align: center; }
.cf-local-business-header .lbh-facts{ justify-content: center; }
}
@media (max-width: 959px){
.cf-local-business-header .lbh-strip-inner{ padding: 8px var(--lbh-gutter); }
.cf-local-business-header .lbh-facts{ gap: 2px 16px; }
.cf-local-business-header .lbh-fact{ white-space: normal; text-wrap: pretty; }
.cf-local-business-header .lbh-fact-rating{ display: none; }
.cf-local-business-header .lbh-main-inner{ flex-wrap: wrap; gap: 12px; min-height: 0; padding: 14px var(--lbh-gutter) 16px; }
.cf-local-business-header .lbh-actions{ display: none; }
.cf-local-business-header .lbh-brand{ flex: 1 1 0; }
.cf-local-business-header .lbh-logo{ width: 44px; height: 44px; }
.cf-local-business-header .lbh-mobile-actions{
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
flex: 0 0 100%;
width: 100%;
margin-top: 4px;
}
.cf-local-business-header .lbh-mobile-actions .lbh-btn{
min-height: 60px;
min-width: 0;
padding: 0 12px;
text-align: center;
}
.cf-local-business-header .lbh-mobile-proof{
display: block;
flex: 0 0 100%;
margin: 0;
text-align: center;
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--ink, #101828);
text-wrap: pretty;
}
.cf-local-business-header .lbh-mobile-proof .lbh-star-base{ color: oklch(from var(--ink, #101828) l c h / 0.28); }
.cf-local-business-header.is-scrolled .lbh-strip,
.cf-local-business-header.is-scrolled .lbh-mobile-proof,
.cf-local-business-header.is-scrolled .lbh-tagline{ display: none; }
.cf-local-business-header.is-scrolled .lbh-main-inner{ padding-block: 10px 12px; }
}
@media (max-width: 359px){
.cf-local-business-header .lbh-mobile-actions .lbh-call svg{ display: none; }
}
@media (max-width: 639px){
.cf-local-business-header .lbh-sheet-svc{ grid-template-columns: 1fr; }
.cf-local-business-header .lbh-sheet-inner{ padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce){
.cf-local-business-header .lbh-dd-panel,
.cf-local-business-header .lbh-sheet{ animation: none; }
.cf-local-business-header .lbh-btn,
.cf-local-business-header .lbh-nav-link,
.cf-local-business-header .lbh-nav-link svg,
.cf-local-business-header .lbh-svc,
.cf-local-business-header .lbh-toggle,
.cf-local-business-header .lbh-main{ transition: none; }
.cf-local-business-header .lbh-cta.is-hover,
.cf-local-business-header .lbh-cta.is-active,
.cf-local-business-header .lbh-btn:hover,
.cf-local-business-header .lbh-btn:active{ transform: none; }
}
`;
pieces/nav/local-business-header/specimen.tsx 49 lines
import __studioImage235c5334 from "../assets/a48a4991e9aab82f.webp";
import React from "react";
import { LocalBusinessHeader } from "../local-business-header";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
const sample = defaults.sample;
export const states = ["default", "hover", "active", "disabled"] as const;
type SpecimenState = (typeof states)[number];
export default function LocalBusinessHeaderSpecimen({ state = "default" }: { state?: SpecimenState }) {
return (
<LocalBusinessHeader
state={state}
sticky
businessName="Brightline Plumbing"
logoImage={slot("logo", __studioImage235c5334)}
logoAlt="Brightline Plumbing logo"
homeHref="#top"
tagline="Same-day repairs with upfront prices."
taglineHighlight="upfront prices"
hoursLabel="Open today"
hours="7:00am – 7:00pm"
isOpen
serviceArea="Serving Austin, Round Rock & Cedar Park"
serviceAreaHref="#area"
guarantee={sample.guarantee}
phone="(512) 555-0142"
callLabel="Call now"
ctaLabel="Get my free quote"
ctaShortLabel="Free quote"
href="#quote"
servicesLabel="Services"
services={[
{ label: "Drain cleaning", detail: "Clear slow drains in one visit", href: "#drains" },
{ label: "Water heaters", detail: "Hot water back the same day", href: "#water-heaters" },
{ label: "Leak detection", detail: "Find hidden leaks before they spread", href: "#leaks" },
{ label: "Toilets & faucets", detail: "Stop the drip and the running tank", href: "#fixtures" },
]}
links={[
{ label: "Reviews", href: "#reviews" },
{ label: "Service area", href: "#area" },
]}
rating={{ score: "4.9", count: "212", source: "Google", href: "#reviews" }}
/>
);
}
| Name | Type | Details |
|---|---|---|
businessName OptionalLocalBusinessHeader |
string |
|
logoImage OptionalLocalBusinessHeader |
string |
|
logoAlt OptionalLocalBusinessHeader |
string |
|
homeHref OptionalLocalBusinessHeader |
string |
|
tagline OptionalLocalBusinessHeader |
string |
|
taglineHighlight OptionalLocalBusinessHeader |
string |
|
hoursLabel OptionalLocalBusinessHeader |
string |
|
hours OptionalLocalBusinessHeader |
string |
|
isOpen OptionalLocalBusinessHeader |
boolean |
|
serviceArea OptionalLocalBusinessHeader |
string |
|
serviceAreaHref OptionalLocalBusinessHeader |
string |
|
guarantee OptionalLocalBusinessHeader |
string |
|
phone OptionalLocalBusinessHeader |
string |
|
phoneHref OptionalLocalBusinessHeader |
string |
|
callLabel OptionalLocalBusinessHeader |
string |
|
ctaLabel OptionalLocalBusinessHeader |
string |
|
ctaShortLabel OptionalLocalBusinessHeader |
string |
|
href OptionalLocalBusinessHeader |
string |
|
onAction OptionalLocalBusinessHeader |
(event: React.MouseEvent<HTMLElement>) => void |
|
onCall OptionalLocalBusinessHeader |
(event: React.MouseEvent<HTMLAnchorElement>) => void |
|
servicesLabel OptionalLocalBusinessHeader |
string |
|
services OptionalLocalBusinessHeader |
ServiceLink[] |
|
links OptionalLocalBusinessHeader |
NavLink[] |
|
rating OptionalLocalBusinessHeader |
BusinessRating |
|
sticky OptionalLocalBusinessHeader |
boolean |
|
state OptionalLocalBusinessHeader |
"default" | "hover" | "active" | "disabled" |
|
copy OptionalLocalBusinessHeader |
Partial<LocalBusinessHeaderCopy> |
|
className OptionalLocalBusinessHeader |
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-focus- 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.
logo- The brand’s logo mark.
-
a48a4991e9aab82f.webp
image/webp · 60.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB