Socket
Socket
Sign inDemoInstall

scrollbar-size

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrollbar-size

Find the size of a scrollbar in the browser.


Version published
Weekly downloads
311
decreased by-32.39%
Maintainers
2
Weekly downloads
 
Created
Source

scrollbar-size

Installation

npm install --save scrollbar-size

Usage

import scrollbarSize from "scrollbar-size"

const sizeOfScrollbar: number = scrollbarSize();

console.log(sizeOfScrollbar); // usually ~20

Notes

The function will return undefined if it is called before the document is ready.

The size of the scrollbar is only calculated the first time the function is called. If your platform has scrollbars that resize, this module will not work for you.

Credits

Thanks to olmokramer for the initial implementation

Issues

If you have any issues, you can file an issue on the github page.

License

scrollbar-size is licensed under the MIT license.

Keywords

FAQs

Package last updated on 23 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc