OverlayScrollbars hides native scrollbars, adds styleable overlays, and keeps native scrolling, accessibility, and SSR-friendly behavior across major browsers.
Overview
OverlayScrollbars is a JavaScript scrollbar plugin that replaces visible native scrollbars with customizable overlay scrollbars while preserving native scrolling behavior and accessibility.
The API supports explicit per-element initialization, theming through CSS custom properties, and framework packages for React, Vue, Angular, Svelte, and Solid. It runs in Firefox, Chrome, Safari, Edge, Opera, and on server runtimes such as Node, Deno, and Bun for SSR workflows.
Options cover padding behavior, update detection without polling, scroll snapping, virtual scrolling libraries, body-element support, and typed TypeScript sources. The dependency-free package is treeshakeable and documented with browser and Node examples.
Maintainers provide dark and light default themes plus hooks for custom classes and styling rules.
Key features
- Styleable overlay scrollbars
- Preserves native scroll mechanics
- Official React, Vue, and Svelte adapters
- TypeScript sources and typings
- SSR support on Node, Deno, and Bun
- CSS custom property theming
- Scroll snapping compatibility
- Treeshakeable modules
Use cases
- Consistent scrollbar styling in web apps
- Accessible custom scroll areas
- SSR sites needing scrollbar control
- Embedding scrollbars in design systems