JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 171
  • Score
    100M100P100Q98197F
  • License MIT

A range slider component for React

Package Exports

  • @gilbarbara/react-range-slider

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@gilbarbara/react-range-slider) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-range-slider

A range slider component for React

Installation

npm i @gilbarbara/react-range-slider

Usage

import React, { Component } from 'react';
import RangeSlider from '@gilbarbara/react-range-slider';

class App extends Component {
  state = {
    x: 10,
    y: 10,
  };

  handleChange = (position, props) => {
    this.setState(position);
  };

  render() {
    const { x, y } = this.state;

    return (
      <RangeSlider
        axis="xy"
        x={x}
        y={y}
        onChange={this.handleChange}
      />
    );
  }
}

Props

axis {'x' | 'y' | 'xy'} ▶︎x
Type of slider

x {number}
Use with axis x or xy

xMin {number} ▶︎0
Min value of X

xMax {number} ▶︎100
Max value of X

xStep {number} ▶︎1
Step of X

y {number}
Use with axis y or xy

yMin {number} ▶︎0
Min value of Y

yMax {number} ▶︎100
Max value of Y

yStep {number} ▶︎1
Step of Y

onChange {function} - required
Change callback

onDragEnd {function}
DragEnd callback

License

MIT