vue-custom-range-slider
This is a simple vue-range slider, that supports custom values, labels and more. The component is based on use with v-model, the value is always a string, for supporting custom values.
Demo
See the slider in action, in this codesandbox
Installation
NPM
npm install --save vue-custom-range-slider
Yarn
yarn add vue-custom-range-slider
Usage examples
Usage like a native range slider
{{ slider }}
Usage with custom values
{{ slider }}
Properties:
All properties are optional
Property | Description | Type | Default |
---|---|---|---|
values | Pass an array of custom values, with corresponding labels (overrides min/max) | array |
[] |
min | Sets the minimum value of the slider | string |
'0' |
max | Sets the maximum value of the slider | string |
'100' |
step | Sets the stepping interval | string |
'1' |
hideLabel | Set, if you want to hide the label above the slider | boolean |
false |
raising | Set if you want a "raising" shape, like: ◁ | boolean |
false |
Events
Name | Description | Type |
---|---|---|
change | Emits the current value on change | string |
Styling
You can easily modify the look of the slider, by overriding the variables in the scss file.
// override variables like this: // import the styling,
All variables can be found in the scss file
Roadmap
- Disabled properties
- Name attributes for form handling
- Better styling options
Contribution
If you have suggestions for improvements, dont hesitate to make an issue or pull request. :)
License
MIT