Problem: Header stays visible on scroll.

Solution#

html
<header class="sticky top-0 z-40 backdrop-blur bg-white/80 border-b">…</header>

Why this works#

sticky needs a scroll ancestor and an inset (top-0); add backdrop-blur for the frosted look.

Variants#

  • Responsive: add screen prefixes to the core classes
  • Dark: pair each color utility with its dark: twin
  • Animated: add transition + a state variant for motion

cookbook/index|Cookbook index · utilities/index|Utilities reference · patterns/index|Layout patterns