Skip to content
IndexRequest a UIAboutContact

Frosted Nav Bar on Scroll

A sticky nav bar that starts clear and turns frosted, with a hairline, once content scrolls under it.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a web page scrolled slightly, the top navigation bar frosted glass with a blurred translucent white background showing soft blurred colour blocks passing underneath, a thin hairline bottom border, logo on the left and three links and a small button on the right, below it colourful content cards partially hidden behind the bar, light theme, flat modern style. Negative: heavy shadows, clutter, text errors, device frames. Reduced motion: static design.

About this pattern

Definition

A frosted nav bar blurs whatever scrolls beneath it, so the bar stays readable while still letting colour show through. At the top of the page it is usually plain and transparent; after the first few pixels of scroll it picks up blur, a tint and a thin bottom border that separates it from the content.

Purpose & UX principles

  • Use position sticky with backdrop-filter: blur(12px) saturate(1.4) and a semi-transparent background.
  • Add the frosted class after about 8 pixels of scroll, using a scroll listener or an IntersectionObserver sentinel.
  • Add a 1px bottom border or shadow only in the scrolled state.
  • Provide a solid fallback background when backdrop-filter is unsupported.

Interaction states

  • Scroll the page area; switch blur and border on or off.

Motion specification

  • The change takes 200ms.
  • Reduced motion: no transition.

Responsive behaviour

  • Blurred backgrounds still need enough text contrast against whatever passes underneath.
  • Large blurs on big areas cost performance on low-end devices.

Code

HTML
<div class="bx"><div class="sc" id="sc"><nav class="nv" id="nv"><b>Studio</b><span>Work</span><span>About</span><span>Contact</span></nav><div class="ct"><i style="background:#ff8a65"></i><i style="background:#4db6ac"></i><i style="background:#7986cb"></i><i style="background:#ffd54f"></i><i style="background:#f06292"></i></div></div><div class="two"><label class="sw"><input id="bl" type="checkbox" checked> Blur</label><label class="sw"><input id="bd" type="checkbox" checked> Hairline border</label></div></div>

Related patterns

Frosted Glass & Acrylic

↗
Frosted Glass & AcrylicSurfaces & Objects

Sticky Header that Shrinks

↗
Sticky Header that ShrinksLayout & Scrolling

Glass Blur Depth

↗
Glass Blur DepthGlass & Tactile