Peek.js — a lightweight JavaScript library that hides your fixed header when users scroll down and reveals it when they scroll up.
Key highlights:
- Zero dependencies, single JS file
-
requestAnimationFrame-based updates for smooth performance - Passive scroll listeners for better main-thread efficiency
- Configurable offset, tolerance, and CSS class names
- Includes a
destroy()method for clean teardown (great for mobile-only patterns) - Works with any framework or vanilla JS setup
Top comments (0)