Skip to content
Vitops
GuidesComponentsPackagesThemeReferenceChangelog

Start here

VitopsInstallationStart a new EmDash siteYour design systemYour config

Live preview

Theme previewAnimation libraryIconsPatternsMastheadConfigure a site

Components

OverviewCSS classesWeb componentsAstro componentsBricks elementsEmDash blocks

Packages

@getvitops/cli@getvitops/astro@getvitops/vite@getvitops/generator@getvitops/core@getvitops/utils@getvitops/emdash@getvitops/create

Reference

Config referenceOutput formatsColour systemType & space scalesComponent patternsIconsConsent gateConversion trackingSearchLegal documentsCSS class vocabularyBricks elements

Releases

Changelog

Masthead

The site's top bar and its navigation behaviour, configured from site.chrome.

OptionsVariantsSticky glass, shadow once scrolledHide on scroll down, back on scroll upFloating, inset from the viewportFluid height and inset (clamp + container units)Transparent over a hero, solid once scrolledFull-width banner at the top, floating once scrolledCompact dropdown (columnar panel under the toggle)Mega menu (the primary-mega tier)

site.chrome says how the top bar looks and how its navigation behaves; the<Masthead> and <SiteNav> Astro components read it, and a prop overrides one field for one layout. It is pure CSS: no script runs for any variant below. The name is masthead, not header or banner — <header> is valid inside any section, and banner is the announcement bar and an ARIA landmark role.

Options

KeyValues
masthead.positionstatic · sticky · fixed (overlays the first section)
masthead.statesatStart · atEnd · scrollingToEnd · scrollingToStart, each a partial look: layout, height, inset, surface, elevation (or false), hidden. Later states win; changes animate.
masthead.surfacesolid · glass · transparent
masthead.layoutfull · inset · floating
masthead.elevationshadow (a shadows key), border
masthead.tone, widtha colour role (role:solid for a fill) · content | full
masthead.height, masthead.inseta CSS length, fluid allowed: 4rem, clamp(3.5rem, 8cqi, 4.5rem). inset is the gap to the viewport for inset/floating (default 0.75rem). cqi follows the page container, vw the viewport.
nav.compactdrawer · dropdown
nav.drawerSide, breakpoints, depthsstart | end · sm…xl · 1–3

Browser support. Every states look usesscroll-state() container queries, which only ever take things away from a settled bar. Chromium gets all of it. A browser without them (Firefox today) shows the settled bar: solid, elevated and always visible — never a transparent one over the page. The effect appears on its own once the browser ships the feature. The bar never slides away while focus or an open menu is inside it.

Variants

Sticky glass, shadow once scrolled

"chrome": { "masthead": { "position": "sticky", "surface": "glass",
  "elevation": { "shadow": "sm" },
  "states": { "atStart": { "elevation": false } } } }

Open full page

Hide on scroll down, back on scroll up

"chrome": { "masthead": { "position": "sticky", "elevation": { "border": true },
  "states": { "scrollingToEnd": { "hidden": true } } } }

Open full page

Floating, inset from the viewport

"chrome": { "masthead": { "position": "sticky", "surface": "glass",
  "layout": "floating", "inset": "1.5rem", "height": "5rem",
  "elevation": { "shadow": "sm" } } }

Open full page

Fluid height and inset (clamp + container units)

"chrome": { "masthead": { "position": "sticky", "surface": "glass",
  "layout": "floating",
  "height": "clamp(3.5rem, 8cqi, 4.5rem)",
  "inset": "clamp(0.5rem, 3cqi, 2rem)" } }

Open full page

Transparent over a hero, solid once scrolled

"chrome": { "masthead": { "position": "fixed", "elevation": { "shadow": "sm" },
  "states": { "atStart": { "surface": "transparent", "elevation": false } } } }

Open full page

Full-width banner at the top, floating once scrolled

"chrome": { "masthead": { "position": "fixed", "surface": "glass",
  "layout": "floating", "height": "4rem", "elevation": { "shadow": "sm" },
  "states": { "atStart": { "layout": "full", "height": "6rem",
    "surface": "transparent", "elevation": false } } } }

Open full page

Compact dropdown (columnar panel under the toggle)

"chrome": { "masthead": { "position": "sticky" },
"nav": { "compact": "dropdown", "breakpoint": "xl" } }

Open full page

Mega menu (the primary-mega tier)

"chrome": { "masthead": { "position": "sticky", "elevation": { "border": true } },
"nav": { "megaBreakpoint": "lg" } }

Open full page

Built with the design system it documents.

@getvitops on npm