0.1.7 • Published 2 years ago

solid-custom-scrollbars v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

solid-custom-scrollbars

npm npm version npm downloads sponsors

Inspiration

Inspired by the battle-tested and original react-custom-scrollbars.

Installation

npm i solid-custom-scrollbars

This assumes that you’re using npm package manager with a module bundler like Webpack or Browserify to consume CommonJS modules.

Usage

This is the minimal configuration. Check out the Documentation for advanced usage.

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:

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.

License

MIT

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago