A lightweight JavaScript library for smart header behavior. Hide on scroll down, reveal on scroll up.
Everything you need for a smart, responsive header
Minimal footprint with zero dependencies. Just pure JavaScript.
Distinguishes intentional scrolling from small movements with tolerance settings.
Uses requestAnimationFrame and passive listeners for smooth scrolling.
Configure offsets, tolerance, and CSS classes to match your design.
The header you see at the top of this page is powered by Peek. Try scrolling up and down to see how it behaves:
Watch the status indicator in the bottom-right corner to see the header states change in real-time!
Get started with just a few lines of code:
Modern web design is all about maximizing screen real estate while maintaining usability. Peek helps you achieve this balance by intelligently managing your header visibility based on user scroll behavior.
Unlike static fixed headers that permanently consume valuable vertical space, Peek gives users more room when they're focused on content, while ensuring navigation is always just a scroll away.
Maximize limited screen space on mobile devices
Let readers focus on articles without distractions
Show more products while keeping navigation accessible
Create immersive experiences with smart navigation
Peek is open source and available on GitHub. Download it, contribute, or report issues.