"use client";
import { SiteHeader } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
brand | ReactNode | — | Logo and name; link it to the home page yourself or use brandHref. |
brandHref | string | — | Wraps brand in a link (e.g. /). |
controls | ReactNode | — | Theme / locale switchers, buttons. Below breakpoint they move into the menu with the links; without links there is no menu and they stay in the bar. |
currentPath | string | — | Current pathname: marks the matching link with aria-current="page" (longest segment-prefix match; links with a #fragment never match). |
links | readonly SiteHeaderLink[] | — | Links: href, label, icon, exact, activePaths, id. |
skipToContent | string | false | #main | Skip link target (default #main, the id AppMain sets); false removes the link. Hidden until it has focus (the first Tab on the page). |
sticky | boolean | true | Stick to the top while scrolling (default true). A sticky header also reserves its height as scroll-padding on the page, in CSS before hydration and measured after, so #anchor links and focus land below it. |
value | string | — | Id of the active link (overrides currentPath matching). |
backdrop | "blur" | "none" | "solid" | blur | blur (translucent + backdrop blur, default), solid or none. |
brandLabel | string | — | Accessible name of the brand link when brand is only a logo. |
brandReactNode
Logo and name; link it to the home page yourself or use brandHref.
brandHrefstring
Wraps brand in a link (e.g. /).
controlsReactNode
Theme / locale switchers, buttons. Below breakpoint they move into the menu with the links; without links there is no menu and they stay in the bar.
currentPathstring
Current pathname: marks the matching link with aria-current="page" (longest segment-prefix match; links with a #fragment never match).
linksreadonly SiteHeaderLink[]
Links: href, label, icon, exact, activePaths, id.
skipToContentdefault #mainstring | false
Skip link target (default #main, the id AppMain sets); false removes the link. Hidden until it has focus (the first Tab on the page).
stickydefault trueboolean
Stick to the top while scrolling (default true). A sticky header also reserves its height as scroll-padding on the page, in CSS before hydration and measured after, so #anchor links and focus land below it.
valuestring
Id of the active link (overrides currentPath matching).
backdropdefault blur"blur" | "none" | "solid"
blur (translucent + backdrop blur, default), solid or none.
brandLabelstring
Accessible name of the brand link when brand is only a logo.
Other props are passed to the root element (HTMLAttributes<HTMLElement>), including className, style, id and aria-* attributes.
Complex object props use fixed fixtures. Primitive props stay editable.
<SiteHeader brand="Pixxl" brandHref="/" links={links} currentPath="/docs" sticky={false} themeSwitcher />const links = [
{ href: "/docs", label: "Docs" },
{ href: "/blog", label: "Blog" },
];
const locales = [
{ id: "en", href: "/en", label: "EN", ariaLabel: "English", lang: "en" },
{ id: "pl", href: "/pl", label: "PL", ariaLabel: "Polski", lang: "pl" },
];
const locale = "en";
const pathname = "/docs";
function Logo() {
return <span>pixxl</span>;
}
<SiteHeader brand={<Logo />} brandHref="/" links={links} currentPath={pathname} skipToContent="#main"
controls={<LocaleSwitcher items={locales} value={locale} />}
themeSwitcher // the house theme control: the same on every site
/>const links = [
{ href: "/docs", label: "Docs" },
{ href: "/blog", label: "Blog" },
];
const locales = [
{ id: "en", href: "/en", label: "EN", ariaLabel: "English", lang: "en" },
{ id: "pl", href: "/pl", label: "PL", ariaLabel: "Polski", lang: "pl" },
];
const locale = "en";
const pathname = "/docs";
function Logo() {
return <span>pixxl</span>;
}
<SiteHeader brand="Pixxl" brandHref="/" links={links} currentPath="/docs" sticky={false} themeSwitcher />