vue-range-slider

Simple slider component of Vue.js
130,041 128
Install
npm install vue-range-slider
Latest Version:0.6.0
Vue:2
License:MIT
Last Updated:Dec 12, 2020
Links: GitHub  ·  npm
Maintainer: ktsn

vue-range-slider

Simple slider component of Vue.js

Features

  • Compatible with native input[type="range"] behavior
  • input, change event support
  • Touch device support

Requirements

Vue >= 2.0

Installation

NPM

npm install --save vue-range-slider

Yarn

yarn add vue-range-slider

Usage

Basic Usage

Just import vue-range-slider component and use it in your components. The props are compatible with native input[type="range"] element, so you can use min, max, step etc. like native element.

<template>
  <range-slider
    class="slider"
    min="10"
    max="1000"
    step="10"
    v-model="sliderValue">
  </range-slider>
</template>

<script>
import RangeSlider from 'vue-range-slider'
// you probably need to import built-in style
import 'vue-range-slider/dist/vue-range-slider.css'

export default {
  data () {
    return {
      sliderValue: 50
    }
  },
  components: {
    RangeSlider
  }
}
</script>

<style>
.slider {
  /* overwrite slider styles */
  width: 200px;
}
</style>

Available props:

  • name - name of the slider input.
  • value - current value of the slider.
  • disabled - if true, the slider value cannot be updated.
  • min - minimum value of the slider.
  • max - maximum value of the slider.
  • step - granularity of the slider value. e.g. if this is 3, the slider value will be 3, 6, 9, ...

Available slots:

  • knob - slot for replacing knob

Overwrite Default Styles

vue-range-slider is built with Sass for its styling. If you want to customize vue-range-slider styles, you can easily do that by configuring Sass variables. Available variables can be seen in the component file.

Example of making the slider knob larger:

// set the variable of the knob size
$knob-size: 30px;

// import the built-in vue-range-slider style
@import '~vue-range-slider/dist/vue-range-slider.scss';

License

MIT

Related Packages

v-range-slider

Range slider component for Vue JS

6,986 8
vue-custom-range-slider

Slider component for vue, with support for custom values

9,327 11
vue-range-multi

A Vue range / slider component that supports one or more thumb

19,540 14
nouislider-vue3

noUiSliderVue es un componente de Vue basado en noUiSlider

8,192 2
vue-double-range-input

Double range input for vue 3 with min and max value that help you select two val...

9,539

Version History

Version Released License
0.6.0 MIT
0.5.1 MIT
0.5.0 MIT
0.4.0 MIT
0.3.2 MIT