5.1 Replace, don't edit
Core's header and footer (core/src/components/Header.tsx, Footer.tsx) are shared by
every site, so a site never edits them. It registers replacements through its
feature's chrome slot:
export const encoreFeature: FeatureModule = {
// …
chrome: { header: EncoreHeader, footer: EncoreFooter },
};
Each is a component that receives the site settings, ({ site }: { site: Site }), and
replaces core's on every page. The last registered feature wins, which is why your feature
goes last in registeredFeatures. You can register just one of the two.
Build them from core's parts, not from scratch. The parts keep the menus, logo and
buttons connected to the admin, so an editor can change the menu without touching code.
A header made of hand-written <a> tags looks right on day one and is out of date the
first time someone edits the menu. (Before 2026-10-06 replacing the header meant exactly
that, which is why the parts exist.)
| Part | Import | Renders |
|---|---|---|
SiteNav |
@/components/SiteNav |
The header menu from Appearance → Menus, dropdowns included |
SiteLogo |
@/components/SiteNav |
The header logo image, or the site name (§5.4) |
SiteHeaderActions |
@/components/SiteNav |
The header button(s) (§5.5) |
navKey |
@/components/SiteNav or @/lib/menus |
A stable key for a menu item, for per-item styling (§5.6) |
SiteFooterLinks |
@/components/FooterParts |
The footer menu from Appearance → Menus |
SiteLegalLinks |
@/components/FooterParts |
The Privacy Policy and Terms links from Appearance → Footer |
Every class prop on every part is optional and defaults to core's look, so you only style
what you want to change. Keep your header and footer in your own feature folder
(src/features/<yours>/Header.tsx).
5.2 A complete header, desktop and mobile
// src/features/encore/Header.tsx
"use client";
import { useState } from "react";
import type { Site } from "@/lib/schemas";
import type { NavItem } from "@/lib/menus";
import { SiteHeaderActions, SiteLogo, SiteNav, navKey } from "@/components/SiteNav";
const ACCENT: Record<string, string> = {
tour: "hover:decoration-[var(--encore-orange)]",
nationals: "hover:decoration-[var(--encore-violet)]",
};
export function EncoreHeader({ site }: { site: Site }) {
const [open, setOpen] = useState(false);
return (
<header className="sticky top-0 z-40 bg-[var(--encore-teal)] text-white">
<div className="mx-auto flex h-20 max-w-7xl items-center justify-between px-6">
<SiteLogo site={site} className="flex shrink-0 items-center text-xl font-bold" />
{/* Desktop menu */}
<SiteNav
site={site}
className="hidden items-center gap-8 md:flex"
linkClassName={(item: NavItem) =>
`font-semibold uppercase hover:underline hover:decoration-wavy ${ACCENT[navKey(item)] ?? ""}`
}
dropdownClassName="mt-2 min-w-56 rounded-md bg-[#111318] py-2 shadow-xl"
dropdownLinkClassName="block px-4 py-2 text-white hover:bg-[#242129]"
toggleClassName="px-1 text-xs text-white/70 hover:text-white"
/>
<SiteHeaderActions
site={site}
className="hidden items-center gap-3 md:flex"
classNameFor={() => "rounded-full bg-[var(--encore-magenta)] px-5 py-2 font-semibold"}
/>
{/* Mobile menu button */}
<button
type="button"
className="inline-flex h-10 w-10 items-center justify-center md:hidden"
aria-label="Menu"
aria-expanded={open}
onClick={() => setOpen((v) => !v)}
>
<span className="text-2xl leading-none">{open ? "×" : "☰"}</span>
</button>
</div>
{/* Mobile menu: the same menu, stacked, with sub-items indented */}
{open ? (
<div className="flex flex-col gap-4 border-t border-white/20 px-6 py-5 md:hidden">
<SiteNav
site={site}
layout="stack"
linkClassName="font-semibold uppercase"
dropdownLinkClassName="text-white/80"
subListClassName="flex flex-col gap-3 border-l border-white/30 pl-4"
onNavigate={() => setOpen(false)}
/>
<SiteHeaderActions
site={site}
className="flex flex-col gap-3"
classNameFor={() => "w-fit rounded-full bg-[var(--encore-magenta)] px-5 py-2 font-semibold"}
onNavigate={() => setOpen(false)}
/>
</div>
) : null}
</header>
);
}
A header that uses useState, as this one does, needs "use client" at the top. Core's
own core/src/components/Header.tsx is the same pattern and a good reference.
Every site needs a mobile menu. A desktop-only SiteNav leaves phone visitors with
no navigation at all. Use a second SiteNav with layout="stack" as above.
5.3 SiteNav in detail
type SiteNavProps = {
site: Site;
layout?: "bar" | "stack"; // default "bar"
className?: string; // the <nav>
linkClassName?: ItemClass; // top-level links
dropdownClassName?: ItemClass; // the dropdown panel (bar)
dropdownLinkClassName?: ChildClass; // links in a dropdown (bar) or sub-list (stack)
subListClassName?: ItemClass; // the indented sub-list (stack)
toggleClassName?: ItemClass; // the dropdown arrow button (bar)
onNavigate?: () => void; // called when any link is followed
};
type ItemClass = string | ((item: NavItem, index: number) => string);
type ChildClass = string | ((child: NavItem, parent: NavItem, index: number) => string);
layout="bar" is a horizontal menu. A dropdown opens on hover and on keyboard focus,
and its arrow button opens it on touch screens. Escape or a click outside closes it. The
parent item keeps its own link, so clicking "Tour" still goes to /tour.
Don't hide the arrow button (toggleClassName="hidden") unless your design opens
dropdowns some other way. On a tablet wide enough for the bar layout there is no hover,
so the arrow is the only way to reach the sub-items. Style it instead.
layout="stack" is a vertical list with each item's sub-items in an indented list
under it. Use it for a mobile menu or a sidebar.
The menu data itself is site.nav, if you need markup SiteNav can't produce:
type NavItem = { label: string; href: string; children?: { label: string; href: string }[] };
Dropdowns are one level deep. They are built in Appearance → Menus with Make
sub-item (tuck an item under the one above it), Add sub-item, and Move out.
Drag to reorder within a level. THINQ Connect's update_menu can edit them too.
5.4 The logo
SiteLogo renders a link to / containing either:
- an image, when
site.header.logois set (logoHeight, default 40px, sets its height), or - the site name (Settings → Site name) as text.
<SiteLogo site={site} className="flex shrink-0 items-center text-xl font-bold" />
There are two ways to show your logo image:
In code (recommended for a designed logo). Put the file in your repo's public/
folder and render it yourself:
import { SiteImage } from "@/components/SiteImage";
<a href="/" className="flex shrink-0 items-center" aria-label={site.name}>
<SiteImage src="/brand/encore-logo.svg" alt={site.name} priority className="h-12 w-auto" />
</a>
The logo then ships with the code, is versioned with the design, and works the same
locally, on staging and live. priority loads it straight away rather than lazily.
As a setting. Set header.logo in the site settings and SiteLogo shows it:
"header": { "logo": "/brand/encore-logo.svg", "logoHeight": 48, "sticky": true, "actions": [] }
Use this when the logo should be changeable without a code change. Today there is no
field for it in the admin: it is set in content/site.json (which only reaches a site
on its first boot; see Pages §6.6),
so on staging or live, ask Bo to set it. A logo picker under Appearance → Header is on the
open list in CHANGELOG.
Verified on 2026-10-21 in a production build of the Encore site: with header.logo set,
SiteLogo rendered <img src="/brand/logo.svg" alt="Encore Performing Arts" style="height:48px">
inside the custom header.
5.5 Header buttons
SiteHeaderActions renders site.header.actions (each { label, href, style }, where
style is primary, outline or link), or, when there are none, the single header
button site.navCta as an outline button.
- Appearance → Header edits that single header button (label and link).
- Several buttons with their own styles are set in
site.header.actions, which has no admin field yet; ask Bo to set it on a live site.
classNameFor(style) styles each button by its style. headerActionClass(style) is
core's default, if you want to extend it:
<SiteHeaderActions site={site} classNameFor={(style) => `${headerActionClass(style)} uppercase`} />
5.6 Styling one menu item differently
Two ways, use whichever suits.
Class functions. Every class prop also takes a function of the item. Dropdown-link functions get the child and then its parent:
const accent: Record<string, string> = { tour: "text-[var(--encore-orange)]", nationals: "text-[var(--encore-violet)]" };
<SiteNav
site={site}
linkClassName={(item) => `font-semibold ${accent[navKey(item)] ?? "text-white"}`}
dropdownClassName={(parent) => `rounded-md py-2 border-t-4 ${navKey(parent) === "tour" ? "border-[var(--encore-orange)]" : "border-white"}`}
dropdownLinkClassName={(child, parent) => `block px-4 py-2 ${navKey(parent) === "tour" ? "hover:bg-orange-950" : "hover:bg-white/10"}`}
/>
The first argument is the menu item ({ label, href, children? }), not a string. Type it
as NavItem from @/lib/menus if you annotate it.
CSS on data-nav. Every top-level link, dropdown panel and dropdown link carries a
data-nav attribute:
[data-nav="tour"] { --accent: var(--encore-orange); }
Keys come from the link, not the label, so an editor can rename "Tour" to "On Tour" without breaking your styling:
| Link | navKey |
|---|---|
/ |
home |
/tour |
tour |
/tour/dallas |
tour-dallas |
/#about |
about |
If an editor changes a link's path, its key changes with it.
5.7 A custom footer
// src/features/encore/Footer.tsx
import type { Site } from "@/lib/schemas";
import { SiteFooterLinks, SiteLegalLinks } from "@/components/FooterParts";
export function EncoreFooter({ site }: { site: Site }) {
return (
<footer className="bg-[var(--encore-teal)] px-6 py-16 text-white">
<div className="mx-auto grid max-w-7xl gap-10 md:grid-cols-3">
<div>
<p className="text-xl font-bold">{site.name}</p>
<p className="mt-3 text-white/80">{site.footer.line}</p>
<p className="mt-2 text-sm uppercase tracking-widest">{site.footer.location}</p>
</div>
<SiteFooterLinks
site={site}
className="flex flex-col gap-2"
linkClassName="font-semibold uppercase hover:underline"
/>
{/* social links (§5.8) and a form (§5.9) can go here */}
</div>
<div className="mx-auto mt-12 flex max-w-7xl flex-wrap justify-between gap-4 text-sm text-white/60">
<p>© {new Date().getFullYear()} {site.name}</p>
<SiteLegalLinks site={site} className="flex gap-5" linkClassName="hover:text-white" />
</div>
</footer>
);
}
SiteFooterLinks: the footer menu from Appearance → Menus. Footer menus are flat: only top-level items are shown.className, andlinkClassName(a string or a function of the link). Links carrydata-navkeys too.SiteLegalLinks: the Privacy Policy and Terms of Service links set in Appearance → Footer. Renders nothing when neither is set.
What an editor can change for the footer today, and where:
| Setting | Field | Where it is edited |
|---|---|---|
| Footer text | site.footer.line |
Appearance → Footer, and THINQ Connect |
| Location line | site.footer.location |
Appearance → Footer, and THINQ Connect |
| Footer menu | site.footer.links |
Appearance → Menus (footer menu), and THINQ Connect |
| Privacy / Terms links | site.footer.privacyPolicyHref, termsOfServiceHref |
Appearance → Footer |
| Social profiles | site.footer.social |
Appearance → Footer (§5.8) |
| Footer call to action | site.footer.cta (text, label, href) |
Appearance → Footer (§5.8) |
| Contact details | site.footer.contact (phone, email, headquarters) |
Not in the admin yet |
| Site name | site.name |
Settings |
Anything else in your footer (a tagline that never changes, a sponsor logo) can simply be written in your component, or, if an editor should control it, see §5.10.
5.8 Social links
The site settings already hold social profiles, site.footer.social, a list of
{ platform, href }. Core also uses that list in the site's structured data (sameAs),
which tells search engines and AI assistants which profiles are really the business's.
So render your footer icons from that list rather than hard-coding the URLs:
const ICONS: Record<string, React.ReactNode> = {
instagram: <InstagramIcon />, // your SVG components
facebook: <FacebookIcon />,
youtube: <YouTubeIcon />,
tiktok: <TikTokIcon />,
};
<ul className="flex gap-4">
{(site.footer.social ?? []).map((s) => (
<li key={s.href}>
<a href={s.href} aria-label={s.platform ?? "Social profile"} rel="me noopener" target="_blank"
className="block h-6 w-6 text-white/80 hover:text-white">
{ICONS[s.platform?.toLowerCase() ?? ""] ?? s.platform}
</a>
</li>
))}
</ul>
Inline SVG icons are best: no extra requests and they take currentColor. Give every
icon link an aria-label, because an icon has no text.
Editors set them in Appearance → Footer → Social links (platform and link, in icon
order). The platform list includes map, for a map or directions link shown with the
icons. For a new site you can also seed them in content/site.json:
"footer": {
"line": "…", "location": "…", "links": [],
"social": [
{ "platform": "instagram", "href": "https://www.instagram.com/…" },
{ "platform": "facebook", "href": "https://www.facebook.com/…" }
]
}
A footer call to action
Appearance → Footer → Call to action holds a line of text and a button
(site.footer.cta: { text?, label, href }), for footers that end with one ("Want more
information?" → Contact us). Core's own footer doesn't print it; render it in yours where
the design has the slot, and print nothing when it is unset:
{site.footer.cta ? (
<div className="footer-cta">
{site.footer.cta.text ? <p>{site.footer.cta.text}</p> : null}
<a className="button" href={site.footer.cta.href}>{site.footer.cta.label}</a>
</div>
) : null}
5.9 A form in the footer
Build the form in Admin → Forms as usual (its fields, notification email, button text and thank-you message), then render it in your footer with the forms feature's client component, giving it the form's id:
import { FormBlockClient } from "@/features/forms/FormBlockClient";
<FormBlockClient
block={{ type: "form", title: "", formId: "newsletter", submitLabel: "", successMessage: "" }}
/>
It loads the form, renders its fields, and submits it with the same spam protection and
notifications as a Form block on a page. The button text and thank-you message come from
the form's own settings in Admin → Forms; submitLabel and successMessage here are
required by the type but not used.
Verified on 2026-10-21 in a production build of the Encore site: the footer rendered the
contact form's fields, a submission showed the form's thank-you message, and was saved
to the form's submissions.
The form id is fixed in your code, so an editor can change the form's fields but not swap which form is in the footer. If they need to, see §5.10.
5.10 Footer content an editor controls
When the footer needs content an editor should change (a footer sign-up form they pick, an announcement, sponsor logos), the options are:
- A site setting, if one exists (§5.7).
- A footer page. Create a page in the admin (for example slug
footer, left as a draft so it is never public on its own), build its content from blocks, and have your footer render that page's blocks. This gives editors the full block editor for the footer. It needs a small server-side helper to load the page, so ask Bo before building it; it is a good candidate for a core feature that every site gets. - A new site setting in core, if the field would suit every site (social links, contact details). Ask Bo.
Don't hard-code content that someone other than you will need to change.
This text is maintained in thinq-site-core at docs/developers/05-header-and-footer.md (commit e72488e) and published here unchanged.