@orderandchaos/react-range-slider
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

orderandchaos-react-range-slider

Linear and logarithmic range sliders for React

NPM

Install

npm install @orderandchaos/react-range-slider

Usage

import React, { useState } from 'react'

import { RangeSlider, RangeSliderTypes } from '@orderandchaos/react-range-slider'
import '@orderandchaos/react-range-slider/dist/index.css'

const App = () => {
  const [linearValue, setLinearValue] = useState<number>(0)
  const [logValue, setLogValue] = useState<number>(100)
  return (
    <>
      <input readOnly={true} value={linearValue}/>
      <RangeSlider value={linearValue} setValue={setLinearValue} min={0} max={100} step={1}/>
      <input readOnly={true} value={logValue}/>
      <RangeSlider value={logValue} setValue={setLogValue} type={RangeSliderTypes.LOG} min={100} max={100000} decimalPlaces={0}/>
    </>
  )
}

export default App

Demo

https://sarcoma.github.io/orderandchaos-react-range-slider/

License

MIT © sarcoma

Readme

Keywords

none

Package Sidebar

Install

npm i @orderandchaos/react-range-slider

Weekly Downloads

0

Version

1.0.11

License

MIT

Unpacked Size

37.5 kB

Total Files

9

Last publish

Collaborators

  • sarcoma