---
title: "Site Header"
description: "A marketing page header: brand, container-aware dropdown nav, and actions. The nav collapses below 30rem container width - pure CSS, popovers native."
slug: "site-header"
---

import { DocPage, PageHeader, SkillPanel, SourceFiles, SourceNote, StatesSection, CodeBlock, Demo, DemoCode, ChangelogEntries, ArchBody, StatsClaim, StatsCards, PageOverlay, DocText, DocLink, H2, SkillField, SkillText, SkillRow, SkillGrid, Variant, ApiPill, Dim, CodeCard, TableCard } from "../../lib/components/index";

<DocPage meta={meta}>

<PageHeader slug="site-header" title="Site Header" component="site-header">
  A marketing page header: brand, container-aware dropdown nav, and actions. The nav collapses below 30rem container width - pure CSS, popovers native.
</PageHeader>

<SkillPanel component="site-header">
  <SkillField label="Native basis">
<SkillText><code>&lt;header&gt;</code> landmark with <code>&lt;nav&gt;</code>; no script. The nav collapses via a container query (<code>@container</code>), so the block adapts to the width it is placed in, not the viewport. Dropdowns compose the <DocLink href="navigation-menu.html">Navigation Menu</DocLink> component: trigger buttons wired with <code>popovertarget</code> and <code>popover</code> panels - the Popover API handles open/close, Escape, and light dismiss natively.</SkillText>
  </SkillField>

  <SkillField label="Web Platform APIs">
<SkillRow>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header" title="banner landmark"><code>&lt;header&gt;</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav" title="navigation landmark with `aria-label`"><code>&lt;nav&gt;</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky_positioning" title="opt-in sticky header, no scroll JS"><code>position: sticky</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries" title="width-aware nav collapse"><code>Container queries</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/API/Popover_API" title="declarative dropdown triggers, zero JS"><code>popovertarget\` / \`popover</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning" title="panels place below their trigger (from navigation-menu)"><code>CSS anchor positioning</code></ApiPill>
    <ApiPill href="https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible" title="keyboard-only focus rings"><code>:focus-visible</code></ApiPill>
  </SkillRow>
  </SkillField>

  <SkillField label="Classes">
<SkillRow>
    <code>.mk-header</code>
    <code>.mk-header-inner</code>
    <code>.mk-header-brand</code>
    <code>.mk-header-name</code>
    <code>.mk-header-nav</code>
    <code>.mk-header-actions</code>
  </SkillRow>
  </SkillField>

  <SkillField label="Variants">
<SkillGrid>
    <Variant name="data-variant" description="Purpose" />
    <Variant name="sticky" description="Header sticks to the top on scroll (opt-in)" />
  </SkillGrid>
  </SkillField>
</SkillPanel>

```html example label="Default" hint="Composes navigation-menu: triggers + popovertarget, no JS." previewStyle="align-items:stretch;" height="20"
<header class="mk-header" style="width: 100%">
  <div class="mk-header-inner">
    <a href="#" class="mk-header-brand"
      ><svg
        viewBox="0 0 24 24"
        width="24"
        height="24"
        fill="none"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
        aria-hidden="true"
      >
        <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg
      ><span class="mk-header-name">Acme Inc.</span></a
    >
    <nav class="mk-header-nav" aria-label="Main">
      <ul class="nav-menu-list">
        <li class="nav-menu-item">
          <button class="nav-menu-trigger" popovertarget="mk-sh-products"
            >Products
            <svg
              aria-hidden="true"
              width="14"
              height="14"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
            >
              <path d="m6 9 6 6 6-6"></path></svg
          ></button>
          <div class="nav-menu-content" id="mk-sh-products" popover>
            <a class="nav-menu-content-link" href="#"
              ><strong>Analytics</strong><p>View your dashboard and metrics</p></a
            >
            <a class="nav-menu-content-link" href="#"
              ><strong>Automation</strong><p>Build workflows and integrations</p></a
            >
          </div>
        </li>
        <li class="nav-menu-item"><a class="nav-menu-link" href="#">Pricing</a></li>
      </ul>
    </nav>
    <div class="mk-header-actions">
      <button type="button" class="btn mk-header-wide" data-variant="ghost" data-size="sm">Login</button>
      <button type="button" class="btn" data-size="sm">Get started</button>
      <button
        type="button"
        class="btn mk-header-menu"
        data-variant="ghost"
        data-size="icon"
        data-sheet-trigger="mk-sh-menu"
        aria-haspopup="dialog"
        aria-label="Open menu"
        ><svg
          viewBox="0 0 24 24"
          width="20"
          height="20"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <line x1="4" x2="20" y1="6" y2="6"></line>
          <line x1="4" x2="20" y1="12" y2="12"></line>
          <line x1="4" x2="20" y1="18" y2="18"></line></svg
      ></button>
    </div>
  </div>

  <dialog
    id="mk-sh-menu"
    class="sheet"
    data-side="right"
    role="dialog"
    aria-modal="true"
    aria-labelledby="mk-sh-menu-title"
  >
    <div class="sheet-content">
      <div class="sheet-header">
        <h2 class="sheet-title" id="mk-sh-menu-title">Acme Inc.</h2>
      </div>
      <div class="sheet-body">
        <p class="mk-header-sheet-label">Products</p>
        <ul class="mk-header-sheet-nav">
          <li
            ><a href="#" data-sheet-close>Analytics <small>Dashboards</small></a></li
          >
          <li
            ><a href="#" data-sheet-close>Automation <small>Workflows</small></a></li
          >
        </ul>
        <p class="mk-header-sheet-label">Company</p>
        <ul class="mk-header-sheet-nav">
          <li><a href="#" data-sheet-close>Pricing</a></li>
        </ul>
      </div>
      <div class="sheet-footer mk-header-sheet-actions">
        <button type="button" class="btn" data-variant="outline">Login</button>
        <button type="button" class="btn">Get started</button>
      </div>
    </div>
  </dialog>
</header>
```

```html example label="Announcement bar" hint=".mk-header-announcement: a primary-colored bar above the header row - one line and a link." previewStyle="align-items:stretch;"
<header class="mk-header" style="width: 100%">
  <div class="mk-header-announcement">
    <p>Acme 4.0 is here: offline sync for every workspace.</p>
    <a href="#"
      >Read the release notes
      <svg
        viewBox="0 0 24 24"
        width="16"
        height="16"
        fill="none"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
        aria-hidden="true"
      >
        <path d="M5 12h14" />
        <path d="m12 5 7 7-7 7" /></svg
    ></a>
  </div>
  <div class="mk-header-inner">
    <a href="#" class="mk-header-brand"
      ><svg
        viewBox="0 0 24 24"
        width="24"
        height="24"
        fill="none"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
        aria-hidden="true"
      >
        <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg
      ><span class="mk-header-name">Acme Inc.</span></a
    >
    <nav class="mk-header-nav" aria-label="Main">
      <ul class="nav-menu-list">
        <li class="nav-menu-item"><a class="nav-menu-link" href="#" aria-current="page">Product</a></li>
        <li class="nav-menu-item"><a class="nav-menu-link" href="#">Pricing</a></li>
        <li class="nav-menu-item"><a class="nav-menu-link" href="#">Customers</a></li>
        <li class="nav-menu-item"><a class="nav-menu-link" href="#">Blog</a></li>
      </ul>
    </nav>
    <div class="mk-header-actions">
      <a class="btn mk-header-wide" data-variant="ghost" data-size="sm" href="#">Log in</a>
      <a class="btn" data-size="sm" href="#">Get started</a>
      <button
        type="button"
        class="btn mk-header-menu"
        data-variant="ghost"
        data-size="icon"
        data-sheet-trigger="hdr-ann-menu"
        aria-haspopup="dialog"
        aria-label="Open menu"
        ><svg
          viewBox="0 0 24 24"
          width="20"
          height="20"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <line x1="4" x2="20" y1="6" y2="6" />
          <line x1="4" x2="20" y1="12" y2="12" />
          <line x1="4" x2="20" y1="18" y2="18" /></svg
      ></button>
    </div>
  </div>
  <dialog
    id="hdr-ann-menu"
    class="sheet"
    data-side="right"
    role="dialog"
    aria-modal="true"
    aria-labelledby="hdr-ann-menu-title"
  >
    <div class="sheet-content">
      <div class="sheet-header"><h2 class="sheet-title" id="hdr-ann-menu-title">Acme Inc.</h2></div>
      <div class="sheet-body">
        <ul class="mk-header-sheet-nav">
          <li><a href="#" data-sheet-close>Product</a></li>
          <li><a href="#" data-sheet-close>Pricing</a></li>
          <li><a href="#" data-sheet-close>Customers</a></li>
          <li><a href="#" data-sheet-close>Blog</a></li>
        </ul>
      </div>
      <div class="sheet-footer mk-header-sheet-actions">
        <a class="btn" data-variant="outline" href="#">Log in</a>
        <a class="btn" href="#">Get started</a>
      </div>
    </div>
  </dialog>
</header>
```

```html example label="Store" hint="data-variant='centered': the brand in the middle, the nav left, the actions right - with an inline search (.mk-header-search, from 48rem) and a cart with a count (.mk-header-count)." previewStyle="align-items:stretch;"
<header class="mk-header" data-variant="centered" style="width: 100%; border-block-end: 1px solid var(--border)">
  <div class="mk-header-inner">
    <a href="#" class="mk-header-brand"
      ><svg
        viewBox="0 0 24 24"
        width="24"
        height="24"
        fill="none"
        stroke="currentColor"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
        aria-hidden="true"
      >
        <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg
      ><span class="mk-header-name">Acme Inc.</span></a
    >
    <nav class="mk-header-nav" aria-label="Main">
      <ul class="nav-menu-list">
        <li class="nav-menu-item"><a class="nav-menu-link" href="#" aria-current="page">Women</a></li>
        <li class="nav-menu-item"><a class="nav-menu-link" href="#">Men</a></li>
        <li class="nav-menu-item"><a class="nav-menu-link" href="#">Sale</a></li>
      </ul>
    </nav>
    <div class="mk-header-actions">
      <form class="mk-header-search" role="search" action="#"
        ><label class="sr-only" for="hdr-q">Search products</label
        ><svg
          viewBox="0 0 24 24"
          width="16"
          height="16"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <circle cx="11" cy="11" r="8" />
          <path d="m21 21-4.3-4.3" /></svg
        ><input class="input" id="hdr-q" type="search" name="q" placeholder="Search" enterkeyhint="search"
      /></form>
      <a class="btn mk-header-icon mk-header-wide" data-variant="ghost" data-size="icon" href="#" aria-label="Account"
        ><svg
          viewBox="0 0 24 24"
          width="18"
          height="18"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
          <circle cx="12" cy="7" r="4" /></svg
      ></a>
      <a class="btn mk-header-icon" data-variant="ghost" data-size="icon" href="#" aria-label="Cart, 3 items"
        ><svg
          viewBox="0 0 24 24"
          width="18"
          height="18"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <circle cx="8" cy="21" r="1" />
          <circle cx="19" cy="21" r="1" />
          <path d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12" /></svg
        ><span class="mk-header-count" aria-hidden="true">3</span></a
      >
      <button
        type="button"
        class="btn mk-header-menu"
        data-variant="ghost"
        data-size="icon"
        data-sheet-trigger="hdr-store-menu"
        aria-haspopup="dialog"
        aria-label="Open menu"
        ><svg
          viewBox="0 0 24 24"
          width="20"
          height="20"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <line x1="4" x2="20" y1="6" y2="6" />
          <line x1="4" x2="20" y1="12" y2="12" />
          <line x1="4" x2="20" y1="18" y2="18" /></svg
      ></button>
    </div>
  </div>
  <dialog
    id="hdr-store-menu"
    class="sheet"
    data-side="right"
    role="dialog"
    aria-modal="true"
    aria-labelledby="hdr-store-menu-title"
  >
    <div class="sheet-content">
      <div class="sheet-header"><h2 class="sheet-title" id="hdr-store-menu-title">Acme Inc.</h2></div>
      <div class="sheet-body">
        <ul class="mk-header-sheet-nav">
          <li><a href="#" data-sheet-close>Women</a></li>
          <li><a href="#" data-sheet-close>Men</a></li>
          <li><a href="#" data-sheet-close>Sale</a></li>
        </ul>
      </div>
      <div class="sheet-footer mk-header-sheet-actions">
        <a class="btn" data-variant="outline" href="#">Log in</a>
        <a class="btn" href="#">Get started</a>
      </div>
    </div>
  </dialog>
</header>
```

```html example label="Sticky" hint="data-variant='sticky' pins the header while the box below it scrolls." previewStyle="align-items:stretch;" height="22"
<div
  style="
    max-height: 20rem;
    overflow: auto;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
  "
>
  <header class="mk-header" data-variant="sticky">
    <div class="mk-header-inner">
      <a href="#" class="mk-header-brand"
        ><svg
          viewBox="0 0 24 24"
          width="24"
          height="24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg
        ><span class="mk-header-name">Acme Inc.</span></a
      >
      <nav class="mk-header-nav" aria-label="Main">
        <ul class="nav-menu-list">
          <li class="nav-menu-item">
            <button class="nav-menu-trigger" popovertarget="mk-sh-sticky-products"
              >Products
              <svg
                aria-hidden="true"
                width="14"
                height="14"
                viewBox="0 0 24 24"
                fill="none"
                stroke="currentColor"
                stroke-width="2"
              >
                <path d="m6 9 6 6 6-6"></path></svg
            ></button>
            <div class="nav-menu-content" id="mk-sh-sticky-products" popover>
              <a class="nav-menu-content-link" href="#"
                ><strong>Analytics</strong><p>View your dashboard and metrics</p></a
              >
              <a class="nav-menu-content-link" href="#"
                ><strong>Automation</strong><p>Build workflows and integrations</p></a
              >
            </div>
          </li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Pricing</a></li>
        </ul>
      </nav>
      <div class="mk-header-actions"
        ><button type="button" class="btn" data-size="sm">Get started</button
        ><button
          type="button"
          class="btn mk-header-menu"
          data-variant="ghost"
          data-size="icon"
          data-sheet-trigger="mk-sh-sticky-menu"
          aria-haspopup="dialog"
          aria-label="Open menu"
          ><svg
            viewBox="0 0 24 24"
            width="20"
            height="20"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <line x1="4" x2="20" y1="6" y2="6"></line>
            <line x1="4" x2="20" y1="12" y2="12"></line>
            <line x1="4" x2="20" y1="18" y2="18"></line></svg></button
      ></div>
    </div>

    <dialog
      id="mk-sh-sticky-menu"
      class="sheet"
      data-side="right"
      role="dialog"
      aria-modal="true"
      aria-labelledby="mk-sh-sticky-menu-title"
    >
      <div class="sheet-content">
        <div class="sheet-header">
          <h2 class="sheet-title" id="mk-sh-sticky-menu-title">Acme Inc.</h2>
        </div>
        <div class="sheet-body">
          <p class="mk-header-sheet-label">Products</p>
          <ul class="mk-header-sheet-nav">
            <li
              ><a href="#" data-sheet-close>Analytics <small>Dashboards</small></a></li
            >
            <li
              ><a href="#" data-sheet-close>Automation <small>Workflows</small></a></li
            >
          </ul>
          <p class="mk-header-sheet-label">Company</p>
          <ul class="mk-header-sheet-nav">
            <li><a href="#" data-sheet-close>Pricing</a></li>
          </ul>
        </div>
        <div class="sheet-footer mk-header-sheet-actions">
          <button type="button" class="btn" data-variant="outline">Login</button>
          <button type="button" class="btn">Get started</button>
        </div>
      </div>
    </dialog>
  </header>
  <div style="height: 32rem; padding: 1.25rem; color: var(--muted-foreground); font-size: 0.875rem"
    >Scroll down - the header stays on top of this box.</div
  >
</div>
```

```html example label="Floating" height="22" hint="data-variant='floating': a blurred, rounded pill that floats over the page and stays on top while it scrolls - scroll the box." previewStyle="align-items:stretch;"
<div
  style="
    max-height: 20rem;
    overflow: auto;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, color-mix(in oklch, var(--primary) 12%, var(--background)), var(--background));
  "
>
  <header class="mk-header" data-variant="floating">
    <div class="mk-header-inner">
      <a href="#" class="mk-header-brand"
        ><svg
          viewBox="0 0 24 24"
          width="24"
          height="24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg
        ><span class="mk-header-name">Acme Inc.</span></a
      >
      <nav class="mk-header-nav" aria-label="Main">
        <ul class="nav-menu-list">
          <li class="nav-menu-item"><a class="nav-menu-link" href="#" aria-current="page">Product</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Pricing</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Customers</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Blog</a></li>
        </ul>
      </nav>
      <div class="mk-header-actions">
        <a class="btn mk-header-wide" data-variant="ghost" data-size="sm" href="#">Log in</a>
        <a class="btn" data-size="sm" href="#">Get started</a>
        <button
          type="button"
          class="btn mk-header-menu"
          data-variant="ghost"
          data-size="icon"
          data-sheet-trigger="hdr-float-menu"
          aria-haspopup="dialog"
          aria-label="Open menu"
          ><svg
            viewBox="0 0 24 24"
            width="20"
            height="20"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <line x1="4" x2="20" y1="6" y2="6" />
            <line x1="4" x2="20" y1="12" y2="12" />
            <line x1="4" x2="20" y1="18" y2="18" /></svg
        ></button>
      </div>
    </div>
    <dialog
      id="hdr-float-menu"
      class="sheet"
      data-side="right"
      role="dialog"
      aria-modal="true"
      aria-labelledby="hdr-float-menu-title"
    >
      <div class="sheet-content">
        <div class="sheet-header"><h2 class="sheet-title" id="hdr-float-menu-title">Acme Inc.</h2></div>
        <div class="sheet-body">
          <ul class="mk-header-sheet-nav">
            <li><a href="#" data-sheet-close>Product</a></li>
            <li><a href="#" data-sheet-close>Pricing</a></li>
            <li><a href="#" data-sheet-close>Customers</a></li>
            <li><a href="#" data-sheet-close>Blog</a></li>
          </ul>
        </div>
        <div class="sheet-footer mk-header-sheet-actions">
          <a class="btn" data-variant="outline" href="#">Log in</a>
          <a class="btn" href="#">Get started</a>
        </div>
      </div>
    </dialog>
  </header>
  <div style="padding: 1.5rem 2rem 4rem">
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 1 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 2 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 3 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 4 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 5 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 6 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 7 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 8 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 9 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)"
      >Section 10 - scroll the box: the header stays on top.</p
    >
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)"
      >Section 11 - scroll the box: the header stays on top.</p
    >
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)"
      >Section 12 - scroll the box: the header stays on top.</p
    >
  </div>
</div>
```

```html example label="Over an image" hint="data-variant='overlay': transparent and white over a hero picture - the wrapper is positioned, the header sits absolutely on top of it." previewStyle="align-items:stretch;"
<div
  style="
    position: relative;
    width: 100%;
    min-height: 22rem;
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #fff;
    isolation: isolate;
  "
>
  <img
    src="images/photos/s-header-coast-1600x800.webp"
    alt=""
    style="position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2"
  />
  <div
    style="
      position: absolute;
      inset: 0;
      z-index: -1;
      background: linear-gradient(oklch(0.15 0.02 260 / 0.6), oklch(0.15 0.02 260 / 0.2));
    "
  ></div>
  <header class="mk-header" data-variant="overlay">
    <div class="mk-header-inner">
      <a href="#" class="mk-header-brand"
        ><svg
          viewBox="0 0 24 24"
          width="24"
          height="24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg
        ><span class="mk-header-name">Acme Inc.</span></a
      >
      <nav class="mk-header-nav" aria-label="Main">
        <ul class="nav-menu-list">
          <li class="nav-menu-item"><a class="nav-menu-link" href="#" aria-current="page">Journeys</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Stories</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">About</a></li>
        </ul>
      </nav>
      <div class="mk-header-actions">
        <a class="btn" data-variant="secondary" data-size="sm" href="#">Book a trip</a>
        <button
          type="button"
          class="btn mk-header-menu"
          data-variant="ghost"
          data-size="icon"
          data-sheet-trigger="hdr-over-menu"
          aria-haspopup="dialog"
          aria-label="Open menu"
          ><svg
            viewBox="0 0 24 24"
            width="20"
            height="20"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <line x1="4" x2="20" y1="6" y2="6" />
            <line x1="4" x2="20" y1="12" y2="12" />
            <line x1="4" x2="20" y1="18" y2="18" /></svg
        ></button>
      </div>
    </div>
    <dialog
      id="hdr-over-menu"
      class="sheet"
      data-side="right"
      role="dialog"
      aria-modal="true"
      aria-labelledby="hdr-over-menu-title"
    >
      <div class="sheet-content">
        <div class="sheet-header"><h2 class="sheet-title" id="hdr-over-menu-title">Acme Inc.</h2></div>
        <div class="sheet-body">
          <ul class="mk-header-sheet-nav">
            <li><a href="#" data-sheet-close>Journeys</a></li>
            <li><a href="#" data-sheet-close>Stories</a></li>
            <li><a href="#" data-sheet-close>About</a></li>
          </ul>
        </div>
        <div class="sheet-footer mk-header-sheet-actions">
          <a class="btn" data-variant="outline" href="#">Log in</a>
          <a class="btn" href="#">Get started</a>
        </div>
      </div>
    </dialog>
  </header>
  <h2 style="margin: 4rem 0 0; font-size: 2.25rem; font-weight: 600; letter-spacing: -0.02em">Travel slower.</h2>
</div>
```

```html example label="Elevate on scroll" height="22" hint="data-elevate on a sticky header: flat at the top, a rule and a shadow appear within the first 64px of scrolling - a scroll-driven animation, no script." previewStyle="align-items:stretch;"
<div
  style="
    max-height: 20rem;
    overflow: auto;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
  "
>
  <header class="mk-header" data-variant="sticky" data-elevate>
    <div class="mk-header-inner">
      <a href="#" class="mk-header-brand"
        ><svg
          viewBox="0 0 24 24"
          width="24"
          height="24"
          fill="none"
          stroke="currentColor"
          stroke-width="2"
          stroke-linecap="round"
          stroke-linejoin="round"
          aria-hidden="true"
        >
          <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg
        ><span class="mk-header-name">Acme Inc.</span></a
      >
      <nav class="mk-header-nav" aria-label="Main">
        <ul class="nav-menu-list">
          <li class="nav-menu-item"><a class="nav-menu-link" href="#" aria-current="page">Product</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Pricing</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Customers</a></li>
          <li class="nav-menu-item"><a class="nav-menu-link" href="#">Blog</a></li>
        </ul>
      </nav>
      <div class="mk-header-actions">
        <a class="btn" data-size="sm" href="#">Get started</a>
        <button
          type="button"
          class="btn mk-header-menu"
          data-variant="ghost"
          data-size="icon"
          data-sheet-trigger="hdr-elev-menu"
          aria-haspopup="dialog"
          aria-label="Open menu"
          ><svg
            viewBox="0 0 24 24"
            width="20"
            height="20"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
          >
            <line x1="4" x2="20" y1="6" y2="6" />
            <line x1="4" x2="20" y1="12" y2="12" />
            <line x1="4" x2="20" y1="18" y2="18" /></svg
        ></button>
      </div>
    </div>
    <dialog
      id="hdr-elev-menu"
      class="sheet"
      data-side="right"
      role="dialog"
      aria-modal="true"
      aria-labelledby="hdr-elev-menu-title"
    >
      <div class="sheet-content">
        <div class="sheet-header"><h2 class="sheet-title" id="hdr-elev-menu-title">Acme Inc.</h2></div>
        <div class="sheet-body">
          <ul class="mk-header-sheet-nav">
            <li><a href="#" data-sheet-close>Product</a></li>
            <li><a href="#" data-sheet-close>Pricing</a></li>
            <li><a href="#" data-sheet-close>Customers</a></li>
            <li><a href="#" data-sheet-close>Blog</a></li>
          </ul>
        </div>
        <div class="sheet-footer mk-header-sheet-actions">
          <a class="btn" data-variant="outline" href="#">Log in</a>
          <a class="btn" href="#">Get started</a>
        </div>
      </div>
    </dialog>
  </header>
  <div style="padding: 1.5rem 2rem 4rem">
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 1 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 2 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 3 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 4 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 5 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 6 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 7 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 8 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)">Section 9 - scroll the box: the header stays on top.</p>
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)"
      >Section 10 - scroll the box: the header stays on top.</p
    >
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)"
      >Section 11 - scroll the box: the header stays on top.</p
    >
    <p style="margin: 0 0 1rem; color: var(--muted-foreground)"
      >Section 12 - scroll the box: the header stays on top.</p
    >
  </div>
</div>
```

<SourceFiles component="site-header" section="css" />

</DocPage>
