Skip to content

Header

.bp-header is a position: sticky header with glassmorphism via @supports (backdrop-filter). The .is-scrolled class is toggled by an IntersectionObserver sentinel. Uses view-transition-name: bp-header for smooth cross-document transitions.

npm

@import "@be-partner-labs/ds/components/header";

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@be-partner-labs/ds/dist/components/header.min.css">

For the full bundle: https://cdn.jsdelivr.net/npm/@be-partner-labs/ds/dist/bpl-ds.min.css

Header with logo, nav placeholder, and theme toggle

<style>
.demo-header { position: relative; }
.demo-header__nav { flex: 1; }
</style>
<header class="bp-header demo-header">
<div class="bp-header__inner">
<a href="/" class="bp-header__logo">Be Partner DS</a>
<nav class="demo-header__nav" aria-label="Main">
<!-- .bp-nav goes here -->
</nav>
<div class="bp-header__actions">
<button class="bp-btn bp-btn--secondary bp-btn--sm" type="button">Sign in</button>
<button class="bp-btn bp-btn--sm" type="button">Get started</button>
</div>
</div>
</header>

is-scrolled state (shadow active)

<style>
.demo-header { position: relative; }
</style>
<header class="bp-header is-scrolled demo-header">
<div class="bp-header__inner">
<a href="/" class="bp-header__logo">Be Partner DS</a>
<div class="bp-header__actions">
<button class="bp-btn bp-btn--sm" type="button">Get started</button>
</div>
</div>
</header>
<!-- Place immediately after the opening <body> tag -->
<div id="header-sentinel" aria-hidden="true" style="height:1px"></div>
<script type="module">
const sentinel = document.getElementById('header-sentinel')
const header = document.getElementById('site-header')
new IntersectionObserver(([entry]) => {
header.classList.toggle('is-scrolled', !entry.isIntersecting)
}).observe(sentinel)
</script>
Variable Default Description
--header-background var(--bp-color-bg-elevated) Background / glassmorphism base
--header-height 4rem Header height
--header-z 100 z-index
✓No axe violationstested 2026-05-11
  • <header> has an implicit banner landmark role.
  • The logo link should be the first focusable element.
  • Add a skip-to-content link before the header in DOM order.
API Availability Used for Without it Polyfill
backdrop-filter Widely availableBaseline 2022 Glassmorphism blur behind the header Solid opaque background, fully functional None needed; @supports guard in CSS
IntersectionObserver Widely availableBaseline 2020 Toggle .is-scrolled shadow on scroll No scroll-state shadow; use a scroll event listener polyfill
View Transitions API Newly availableBaseline 2024 Smooth cross-document header animation Instant page transitions, header snaps None needed
color-mix() Widely availableBaseline 2023 Glassmorphism background tint Solid token color used instead None needed; @supports guard in CSS
Container Queries Widely availableBaseline 2023 Actions area stacks at small header width Static horizontal layout None needed
  • --_background, --_height, --_z — component-private, do not set directly.