Site header
Navigation is passed as items. An item with columns opens a mega menu
on wide screens and becomes an accordion in the mobile drawer. Below 60rem
the nav and call to action move into a drawer opened by the menu button.
Options
Section titled “Options”items: list of{ label, href, current }, or{ label, columns, promo }for a mega menu, wherecolumnsis{ heading, links }[]andpromois{ image, title, href }layout:split(default: logo start, nav end),centered(logo centred, nav on a row beneath),row(logo start, nav centred, actions end)sticky: sticks to the top of the viewportoverlay: sits transparent over the hero beneath it, with white text, and turns solid once the page scrolls or a mega menu opens (data-state="scrolled")cta:{ label, href }for the call to action buttonsearch,account,cart: hrefs for icon links;cartCountadds a count badgeid: id of the mobile drawer (defaultsite-menu), unique per pagelabel: accessible name of the primary nav (default “Primary”)menuTitle: drawer heading (default “Menu”)- Slots:
logo;actionsfor extra controls before the call to action;navfor the site’s own navigation markup whenitemsis not set (it stays visible at every width, with no drawer)
<SiteHeader items={[ { label: "Library", columns: [{ heading: "Elements", links: [...] }] }, { label: "Getting started", href: "/getting-started/", current: true }, { label: "Sections", href: "/sections/hero/" }, ]} cta={{ label: "Get started", href: "/getting-started/" }} sticky> <Logo href="/" slot="logo">samla<span aria-hidden="true">.</span></Logo></SiteHeader>Scroll this frame.
A design system built for speed
The header stays readable over the image.