0.0.2 • Published 5 years ago

@inthepocket/itp-rcc-slider v0.0.2

Weekly downloads
3
License
MIT
Repository
-
Last release
5 years ago

ITP Slider component

A simple slider component based on react-compound-slider.

Usage

$ npm install @inthepocket/itp-rcc-slider

Import

import Slider from '@inthepocket/itp-rcc-slider';

JSX

<Slider values={[3]} />

API documentation

Slider

<Slider
  values={[3]}
  domain={[0, 10]}
  step={1}
  onChange={values => console.log(values)}
  right={false}
/>
PropertyDescriptionTypeDefaultRequired
...slider propsSee react-compound-slider slider docs---
leftBoolean value to control whether the left most track is included in the tracks array. 1booleantrue-
rightBoolean value to control whether the right most track is included in the tracks array. 1booleantrue-
prefixCssPrefix for css classNamesstring'slider'No
stylesimported css module (if passed, prefixed classNames will be disabled), see styles propertyObjectnullNo

1 See react-compound-slider Tracks docs

Styles property

PropertyDescriptionTypeDefaultRequired
Slider-string-Yes
Rail-string-Yes
Track-string-Yes
Handle-string-Yes
isHandleActive-string-No

The css module should look like this:

.Slider {}
.Rail {}
.Track {}
.Handle {}
.isHandleActive {}

Development

Installation

$ npm install

Test

$ npm run test

Build

Compiles the TypeScript source to ES5.

$ npm run build