Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Nouislider | 5,384 | 1,399 | 307 | 4 months ago | 53 | August 12, 2022 | 29 | mit | TypeScript | |
noUiSlider is a lightweight, ARIA-accessible JavaScript range slider with multi-touch and keyboard support. It is fully GPU animated: no reflows, so it is fast; even on older devices. It also fits wonderfully in responsive designs and has no dependencies. | ||||||||||
Ion.rangeslider | 2,532 | 2 months ago | 131 | mit | JavaScript | |||||
jQuery only range slider | ||||||||||
Flutter_app | 2,417 | 3 months ago | 9 | apache-2.0 | Dart | |||||
🔥🔥🔥本项目包括各种基本控件使用(Text、TextField、Icon、Image、Listview、Gridview、Picker、Stepper、Dialog、Slider、Row、Appbar、Sizebox、BottomSheet、Chip、Dismissible、FlutterLogo、Check、Switch、TabBar、BottomNavigationBar、Sliver等)、豆瓣电影、tubitv、每日一文、和天气、百姓生活、随机诗词、联系人、句子迷、好奇心日报、有道精品课、高德定位、音乐播放器🎵、追书神器等板块 | ||||||||||
Vue Slider Component | 2,292 | 394 | 223 | 6 months ago | 195 | July 28, 2022 | 24 | mit | TypeScript | |
🌡 A highly customized slider component | ||||||||||
Rangeslider.js | 2,162 | 131 | 14 | 8 months ago | 26 | October 06, 2019 | 74 | mit | JavaScript | |
🎚 HTML5 input range slider element polyfill | ||||||||||
React Slider | 815 | 319 | 97 | 5 days ago | 47 | May 16, 2022 | 15 | mit | JavaScript | |
Accessible, CSS agnostic, slider component for React. | ||||||||||
Nmrangeslider | 731 | 31 | 3 years ago | 3 | March 24, 2015 | 42 | mit | Objective-C | ||
A custom range slider for iOS | ||||||||||
React Input Range | 705 | 601 | 124 | a year ago | 33 | January 06, 2018 | 125 | mit | JavaScript | |
React component for inputting numeric values within a range (range slider) | ||||||||||
React Rangeslider | 620 | 390 | 111 | 8 months ago | 16 | September 19, 2017 | 92 | mit | JavaScript | |
A lightweight responsive react range slider component.A fast & lightweight react component as a drop in replacement for HTML5 input range slider element. | ||||||||||
Deskapp | 595 | a month ago | 2 | July 03, 2020 | mit | HTML | ||||
DeskApp Admin is a free to use Bootstrap 4 admin template. |
InputRange
is a React component allowing users to input numeric values within a specific range. It can accept a single value, or a range of values (min/max). By default, basic styles are applied, but can be overridden depending on your design requirements.
A CodePen demo is available here.
react-input-range
using npm (or yarn). npm install react-input-range
react-input-range
to use InputRange
component.react-input-range/lib/css/index.css
if you want to apply the default styling.To accept min/max value:
import React from 'react';
import ReactDOM from 'react-dom';
import InputRange from 'react-input-range';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
value: { min: 2, max: 10 },
};
}
render() {
return (
<InputRange
maxValue={20}
minValue={0}
value={this.state.value}
onChange={value => this.setState({ value })} />
);
}
}
ReactDOM.render(
<App />,
document.getElementById('app')
);
To accept a single value:
class App extends React.Component {
constructor(props) {
super(props);
this.state = { value: 10 };
}
render() {
return (
<InputRange
maxValue={20}
minValue={0}
value={this.state.value}
onChange={value => this.setState({ value })} />
);
}
}
To format labels:
<InputRange
formatLabel={value => `${value}cm`}
value={this.state.value}
onChange={value => this.setState({ value })} />
To specify the amount of increment/decrement
<InputRange
step={2}
value={this.state.value}
onChange={value => this.setState({ value })} />
Set to true
to allow minValue
and maxValue
to be the same.
Set aria-labelledby
attribute to your component.
Set aria-controls
attribute to your component.
Override the default CSS classes applied to your component and its sub-components.
If this property is set to true, your component is disabled. This means you'll not able to interact with it.
If this property is set to true, you can drag the entire track.
By default, value labels are displayed as plain numbers. If you want to change the display, you can do so by passing in a function. The function can return something different, i.e.: append a unit, reduce the precision of a number.
Set a maximum value for your component. You cannot drag your slider beyond this value.
Set a minimum value for your component. You cannot drag your slider under this value.
Set a name for your form component.
Whenever your user interacts with your component (i.e.: dragging a slider), this function gets called. Inside the function, you should assign the new value to your component.
Whenever your user starts interacting with your component (i.e.: onMouseDown
, or onTouchStart
), this function gets called.
Every mouse / touch event can trigger multiple updates, therefore causing onChange
callback to fire multiple times. On the other hand, onChangeComplete
callback only gets called when the user stops dragging.
The default increment/decrement of your component is 1. You can change that by setting a different number to this property.
Set the current value for your component. If only a single number is provided, only a single slider will get rendered. If a range object (min/max) is provided, two sliders will get rendered
If you want to work on this project locally, you need to grab all of its dependencies, for which we recommend using yarn. You can find the instructions to setup yarn here.
yarn install
After that, you should be able run to preview
yarn dev
To test
yarn test
Contributions are welcome. :)