Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Chilledson/vue-material-slider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2ad6b25 · Feb 13, 2021
Dec 19, 2020
Feb 13, 2021
Dec 11, 2018
Feb 10, 2021
Nov 23, 2018
Nov 29, 2020
Nov 29, 2020
Nov 21, 2020
Nov 22, 2020
Feb 13, 2021
Feb 13, 2021
Nov 23, 2018
Dec 9, 2020
Dec 14, 2018

Repository files navigation

Vue Material Slider

A material design slider build with vue. Live demo

Contents

Installation

npm install vue-material-slider --save

Import

Import and use in vue individually

import Vue from 'vue'
import "vue-material-slider/dist/vue-material-slider.css";
import { Slider, RangeSlider }  from "vue-material-slider";

Install all at once

import 'vue-material-slider/dist/vue-material-slider.css';
import VueMaterialSlider from 'vue-material-slider';
Vue.use(VueMaterialSlider);

Basic slider

Use in your components

<template>
  <vue-material-slider
    :min="10"
    :max="20"
    v-model="value"
  />
</template>

<script>
export default {
  data() {
    return {
      value: 0
    }
  }
}
</script>

Range Slider

<template>
  <vue-material-range-slider v-model="value" />
</template>

<script>
export default {
  data() {
    return {
      // Each array value corresponds to a new thumb
      value: [0, 25, 50]
    }
  }
}
</script>

Properties

Prop Type default Description
min number 0 The minimum value of the slider
max number 100 The maximum value of the slider
thumbLabel boolean false Whether or not to show the label
invert boolean false Set to true to reverse the slider
vertical boolean false Set to true to make the slider vertical
displayWith function null Function that will be used to format the value before it is displayed in the thumb label. Can be used to format very large number in order for them to fit into the slider thumb.
disabled boolean false Whether the component is disabled.
stepSize number 1 The size of each step