Components
← All components

Smart Sticky Header

stimeo--smart-sticky-header

Hides the header on scroll-down and reveals it on scroll-up (with a focus-reveal guarantee).

  • Core

The stimeo--smart-sticky-header controller adds the direction sense that stimeo--sticky-observer deliberately lacks: scrolling down past offset publishes data-header-hidden="true", any scroll-up (beyond the tolerance jitter guard) or returning above offset reveals it, and focus entering the header always reveals it — a keyboard user tabbing into a hidden header must see where focus went (WCAG 2.4.7 / 2.4.11). The slide-away transform and its reduced-motion opt-out are the consumer's CSS. The scroll source is the window by default; point containerSelector at an overflow container when the header lives inside one (as in this demo).

running

Scroll down inside the frame to tuck the bar away; scroll up — or Tab into it — to bring it back.

Acme Docs

Paragraph 1: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 2: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 3: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 4: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 5: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 6: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 7: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 8: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 9: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.

Paragraph 10: keep scrolling — the bar hides while you read downward and returns the moment you scroll back up.