# solid-custom-scrollbars

> Custom Scrollbars for Solid

Latest version **0.1.7** (published 2022-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install solid-custom-scrollbars
pnpm add solid-custom-scrollbars
yarn add solid-custom-scrollbars
bun add solid-custom-scrollbars
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2022-07-05 |
| First published | 2022-06-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 101.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Dirag Biswas |
| Maintainers | diragb |
| Keywords | scrollbars, scrolling, solid, custom scrollbars, ui |

## Links

- npm: https://www.npmjs.com/package/solid-custom-scrollbars
- Repository: https://github.com/diragb/solid-custom-scrollbars
- Homepage: https://github.com/diragb/solid-custom-scrollbars#readme
- Issues: https://github.com/diragb/solid-custom-scrollbars/issues
- Funding: https://github.com/sponsors/diragb
- npm.io page: https://npm.io/package/solid-custom-scrollbars

## Dependencies (2)

- [raf](https://npm.io/package/raf.md) ^3.4.1
- [dom-css](https://npm.io/package/dom-css.md) ^2.1.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2022-07-05
- 0.1.6 — 2022-07-05
- 0.1.5 — 2022-07-05
- 0.1.4 — 2022-07-05
- 0.1.3 — 2022-07-05
- 0.1.2 — 2022-07-05
- 0.1.1 — 2022-06-16
- 0.1.0 — 2022-06-16

## README

# solid-custom-scrollbars

[![npm](https://img.shields.io/badge/npm-solid--custom--scrollbars-brightgreen.svg?style=flat-square)](https://www.npmjs.com/package/solid-custom-scrollbars)
[![npm version](https://img.shields.io/npm/v/solid-custom-scrollbars.svg?style=flat-square)](https://www.npmjs.com/package/solid-custom-scrollbars)
[![npm downloads](https://img.shields.io/npm/dm/solid-custom-scrollbars.svg?style=flat-square)](https://www.npmjs.com/package/solid-custom-scrollbars)
[![sponsors](https://img.shields.io/github/sponsors/diragb)](https://github.com/sponsors/diragb)

* frictionless native browser scrolling
* native scrollbars for mobile devices
* [fully customizable](https://github.com/diragb/solid-custom-scrollbars/blob/master/docs/customization.md)
* [auto hide](https://github.com/diragb/solid-custom-scrollbars/blob/master/docs/usage.md#auto-hide)
* [auto height](https://github.com/diragb/solid-custom-scrollbars/blob/master/docs/usage.md#auto-height)
* [universal](https://github.com/diragb/solid-custom-scrollbars/blob/master/docs/usage.md#universal-rendering) (runs on client & server)
* `requestAnimationFrame` for 60fps
* no extra stylesheets
* well tested, 100% code coverage


## Inspiration
Inspired by the battle-tested and original [react-custom-scrollbars](https://www.npmjs.com/package/react-custom-scrollbars).

## Installation
```bash
npm i solid-custom-scrollbars
```

This assumes that you’re using [npm](http://npmjs.com/) package manager with a module bundler like [Webpack](http://webpack.github.io) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html).

## Usage

This is the minimal configuration. [Check out the Documentation for advanced usage](https://github.com/diragb/solid-custom-scrollbars/tree/master/docs/usage.md).

```tsx
import type { Component } from 'solid-js'
import Scrollbars from 'solid-custom-scrollbars'

const App: Component = () => {
  return (
    <Scrollbars style={{ width: 500, height: 300 }}>
      <p>Some great content...</p>
    </Scrollbars>
  )
}
```

The `<Scrollbars>` component is completely customizable. Check out the following code:

```tsx
import type { Component } from 'solid-js'
import Scrollbars from 'solid-custom-scrollbars'

const CustomScrollbars: Component = () => {
  return (
    <Scrollbars
      onScroll={ handleScroll }
      onScrollFrame={ handleScrollFrame }
      onScrollStart={ handleScrollStart }
      onScrollStop={ handleScrollStop }
      onUpdate={ handleUpdate }
      renderView={ renderView }
      renderTrackHorizontal={ renderTrackHorizontal }
      renderTrackVertical={ renderTrackVertical }
      renderThumbHorizontal={ renderThumbHorizontal }
      renderThumbVertical={ renderThumbVertical }
      autoHide
      autoHideTimeout={ 1000 }
      autoHideDuration={ 200 }
      autoHeight
      autoHeightMin={ 0 }
      autoHeightMax={ 200 }
      thumbMinSize={ 30 }
      universal={ true }
      { ...props }>
  )
}
```

All properties are documented in the [API docs](https://github.com/diragb/solid-custom-scrollbars/blob/master/docs/API.md).

## License
MIT

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