You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

multi-range-slider-react

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-range-slider-react

react component that return two value minValue and maxValue by event onInput/onChange.

1.0.7
Source
npm
Version published
Weekly downloads
4.6K
-26.51%
Maintainers
1
Weekly downloads
 
Created
Source

multi-range-slider-react

a react component that can easy to use and interact with parent component with props and events.

No Dependency only single component file and css file

MultiRangeSlider.jsx , MultiRangeSlider.css

You can customize css to change UI/UX.

Following is the list of props that control the component

propstypedefaultdescription
minNumber0Slider Minimum Value that user can set
maxNumber100Slider Maximum Value that user can Set
minValueNumber25Slider range selected minimum value that will show default selected
maxValueNumber75Slider range selected maximum value that will show default selected
stepNumber5Slider change value that will change when bar clicked or keyboard arrow key pressed
preventWheelBooleanfalsetrue then it not accept mouse wheel to change its value. false then (shift + wheel) change minValue (ctrl+wheel) change maxValue, (ctrl+shift+wheel) change both values
rulerBooleantrueis ruler visible or not
labelBooleantrueis label visible or not
baseClassNameStringmulti-range-sliderChange CSS style of your own

How to Install

copy following code and run on CLI

npm install multi-range-slider-react

How to use

Example Code

download from gitHub

App.js
import React, { useState } from "react";
import MultiRangeSlider from "multi-range-slider-react";
function App() {
const [minValue, set_minValue] = useState(25);
const [maxValue, set_maxValue] = useState(75);
const handleInput = (e) => {
	set_minValue(e.minValue);
	set_maxValue(e.maxValue);
};

return (
	<div className="App">
		<MultiRangeSlider
			min={0}
			max={100}
			step={5}
			ruler={true}
			label={true}
			preventWheel={false}
			minValue={minValue}
			maxValue={maxValue}
			onInput={(e) => {
				handleInput(e);
			}}
		/>
	</div>
	);
}

export default App;






View Demo

Click here to view DEMO

Click here to view DEMO + Example Code






License

(Free to use)






Author

Govind Prasad Gupta

developergovindgupta

Keywords

multi

FAQs

Package last updated on 06 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts