Skip to content

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.

Menu

  • items: list of { label, href, current }, or { label, columns, promo } for a mega menu, where columns is { heading, links }[] and promo is { 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 viewport
  • overlay: 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 button
  • search, account, cart: hrefs for icon links; cartCount adds a count badge
  • id: id of the mobile drawer (default site-menu), unique per page
  • label: accessible name of the primary nav (default “Primary”)
  • menuTitle: drawer heading (default “Menu”)
  • Slots: logo; actions for extra controls before the call to action; nav for the site’s own navigation markup when items is 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>
layout="row", utility actions as a shop would use them
layout="centered"
sticky (scroll inside the frame)
overlay, over a background hero

A design system built for speed

The header stays readable over the image.

nav slot, for custom navigation markup