1.0.5 • Published 12 months ago

scroll-view-bar v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

scroll-view-bar

NPM version NPM downloads

Scroll bar with thumbnail background, similar to vscode side navigation

  • Support for listening to the status of the scrollbar being generated
  • Support custom scrollbar styles

npm.io

Installation

npm install scroll-view-bar --save

Usage

import ScrollViewBar from 'scroll-view-bar';

export default () => (
  <ScrollViewBar style={{height:300}} trigger={'滚动导航'} delay={0}>
    <div>content<div>
  </ScrollViewBar>
);

API

PropertyTypeDefaultDescription
prefixClsStringscroll-view-barprefixCls of this component
triggerReact.ReactNodescroll navigationWhen the mouse hovers over the hover-button, trigger the scroll bar display
delaynumber2000The delay in first loading the background image
observablebooleanfalseWhether to enable content change monitoring for updating the scrollbar background
trackWidthnumber160scroll-track width
trackStyleCSSPropertiesscroll-view-barcustomize track style
thumbStyleCSSPropertiesscroll-view-barcustomize thumb style
onUpdate(value: {top: number;scrollTop: number;scrollHeight: number;clientHeight: number;})=>voidcall when scrolling

Development

# install dependencies
$ npm install

# develop library by docs demo
$ npm start

# build library source code
$ npm run build

# build library source code in watch mode
$ npm run build:watch

# build docs
$ npm run docs:build

# check your project for potential problems
$ npm run doctor

LICENSE

MIT

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago