design-infraGitHub
Report a problem or share feedback← Catalog

Scroll Direction: Hide Header

curatedfree

motion/scroll-hide-header

A sticky header that hides when scrolling down and reappears when scrolling up. Uses useMotionValueEvent to detect scroll direction.

scroll — subtlerecipeRefinedPlayful
$pnpm add motion # then adapt the free source from https://motion.dev/examples/react-scroll-hide-header

npm deps: motion

Our notes

Header that hides on scroll down and returns on scroll up (useMotionValueEvent). Great default for marketing navbars. Free example (motion is MIT); copy and adapt the source from the example page.
Scroll Direction: Hide Header preview
Source
Motion (motion.dev)
Kind
transition
Categories
transition, scroll-effect
Use as
recipe — technique you apply to your own markup
Applies to
navigation
Motion
on scroll · subtle · motion · low cost
Tags
motion, useScroll, useMotionValueEvent, animate
Licence
motion / motion/react / motion-v are MIT. Motion+ (premium components, example source, AI Kit pro tools) is paid — one-time Personal licence or per-seat Business.
Live demo
motion.dev
Docs
motion.dev