useScrollLock — Full-screen Mobile Menu
- from @astryx
- by Astryx
A custom full-screen menu opened from a Menu button. useScrollLock pins the page behind it while it is open, so the page does not scroll or shift sideways, and closing the menu returns the reader to the same scroll position.
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @astryx/example-use-scroll-lock-full-screen-mobile-menuRegistry dependencies0
The CLI adds no other registry items with this one.
