Skip to main content
UI / UXLayout & ResponsiveDiagramBeginner

Sticky Header

KO: 스티키 헤더·EN: Sticky Header·JA: スティッキーヘッダー

A navigation bar that remains anchored to the top of the viewport during scrolling so key links, search, and actions stay reachable

Table of Contents

Structure Diagram

Sticky Header State Transitions Across Scroll
Header State4 steps
STEP 1Expanded (Flat)(20%)
Quick Answer

What is Sticky Header?

A navigation bar that remains anchored to the top of the viewport during scrolling so key links, search, and actions stay reachable. It is a core concept in Layout & Responsive within UI / UX.

Core Principles

A Sticky Header uses position: sticky; top: 0 so the navigation bar participates in normal document flow until scrolling reaches the top edge, where it anchors to the viewport. Unlike position: fixed, it reserves its own layout space automatically without requiring manual top padding on the page body.

Once scrolled past the top, adding a subtle bottom border, elevation shadow, or backdrop-filter: blur() separates the header cleanly from scrolling content underneath.

Practical Takeaways

  • Keep vertical footprint slim (56–64px): Oversized sticky bars steal valuable reading space, especially on mobile. Consider shrinking on scroll or using a headroom pattern that hides on scroll-down and reveals immediately on scroll-up.
  • Prevent anchor occlusion with scroll-margin-top: Apply scroll-margin-top (matching header height + gap) to anchored headings so hash navigation never lands hidden behind the bar.
  • Watch out for ancestor overflow: hidden: Sticky positioning breaks if any ancestor uses overflow: hidden, auto, or scroll. Prefer overflow: clip when horizontal clipping is needed.

Notable Examples

  • Documentation shells: Pinning global search (⌘K), breadcrumbs, and theme controls across long technical guides.
  • E-commerce sticky buy bars: Showing a compact product price and primary checkout CTA once the hero purchase button scrolls out of view.
  • Sticky table headers: Keeping thead column labels anchored while scanning dense analytics spreadsheets.