# scrollbar-size

> Find the size of a scrollbar in the browser.

Latest version **2.1.0** (published 2017-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install scrollbar-size
pnpm add scrollbar-size
yarn add scrollbar-size
bun add scrollbar-size
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2017-08-23 |
| First published | 2014-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Olympic Software |
| Maintainers | andrewh, olympic |
| Keywords | scroll, scrollbar, size, width, browser |

## Links

- npm: https://www.npmjs.com/package/scrollbar-size
- Repository: https://github.com/olympicsoftware/scrollbar-size
- Issues: https://github.com/olympicsoftware/scrollbar-size/issues
- npm.io page: https://npm.io/package/scrollbar-size

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2017-08-23
- 2.0.0 — 2017-08-23
- 1.0.8 — 2017-08-23
- 1.0.7 — 2017-08-23
- 1.0.6 — 2017-08-23
- 1.0.5 — 2017-08-23
- 1.0.4 — 2014-12-23
- 1.0.3 — 2014-09-29
- 1.0.2 — 2014-09-29
- 1.0.1 — 2014-09-25
- 1.0.0 — 2014-09-25

## README

# [scrollbar-size](https://github.com/olympicsoftware/scrollbar-size)

## <a name="installation-usage"></a>Installation

```
npm install --save scrollbar-size
```

## Usage

```typescript
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](https://github.com/olmokramer/) for the initial
implementation

## <a name="issues"></a>Issues

If you have any issues, you can file an issue on the
[github page](https://github.com/olympicsoftware/scrollbar-size/issues).

## <a name="license"></a>License

scrollbar-size is licensed under the [MIT license](LICENSE).

---
_Source: https://npm.io/package/scrollbar-size · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
