Socket
Socket
Sign inDemoInstall

vue-round-slider

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-round-slider

A round slider component for Vue.js with range support. Also it can be any kind of arc slider such as pie shape, half / semi-circle, quarter circle shape sliders.


Version published
Weekly downloads
1.1K
increased by11.08%
Maintainers
1
Install size
1.55 MB
Created
Weekly downloads
 

Readme

Source

https://vue.roundsliderui.com

A highly customizable round slider for vue js with more flexibility

vue-round-slider - circle slider, pie shape slider, range slider

Like it? Then give a star.


Table of contents


Features

  • Great look and feel with lots of customization
  • Supports two-way data binding
  • Range slider support
  • Different circle shapes (pie, half, quarter) support
  • Touch support
  • Keyboard support
  • Mouse scroll support
  • Supports all CSS3 animations

Getting started

Installation

You can install the vue-round-slider package from NPM through the below command.

npm install vue-round-slider --save

Usage

Without any configuration you can simply render the slider, with the default props.

<round-slider />

Or, you can render with your own customizaition:

<round-slider
  v-model="sliderValue"
  start-angle="315"
  end-angle="+270"
  line-cap="round"
  radius="120"
/>

And then import and initialize the component:

import Vue from 'vue'
import RoundSlider from 'vue-round-slider'

new Vue({
  el: '#app',
  components: {
    RoundSlider,
  },
  data() {
    return {
      sliderValue: 60
    }
  },
})

Quick Start

The easiest way to try and start using vue-round-slider is using JSFiddle or CodeSandbox. For round-slider projects,

APIs

Props

For better understanding the props was arranged based on some categories such as Basic props (frequently used), UI appearance related, Behaviour related, Miscellaneous and some Usecase related props.

Note: All the props supports String data type as well as their own type.

nametypedefaultdescription
minNumber0The min property indicates the minimum value of the slider.
maxNumber100The max property indicates the maximum value of the slider.
stepNumber1Decides the number of steps or value should take while we move the handle.
valueString, NumbernullSets or gets the value of the slider. Instead, by using `v-modal` you can enable the two-way data binding.
radiusNumber105The radius property indicates the radius of the slider's circle.
widthNumber20Indicates the width (or thickness) of the slider.
lineCapString"butt"The lineCap property mentions the shape at the edge of the path and range bars. 
startAngleNumber0Indicates the starting angle of the slider.
endAngleString, Number"+360"Indicates the end angle of the slider arc. So, endAngle 90 means it's a quarter circle, like wise 180 - half circle and 270 pie circle
borderWidthNumber0Indicates the border width of the slider.
borderColorString"inherit"Sets the border color of the slider. By default it will inherits the `rangeColor` value.
pathColorString"#EEE"Sets the path color of the slider.
rangeColorString"#69F"Sets the range color of the slider.
tooltipColorString"inherit"Sets the tooltip color of the slider. By default it will inherits the `rangeColor` value.
sliderTypeString"min-range"Indicates the slider type to be render. By setting "range" it will becomes a range slider.
circleShapeString"full"Indicates the circle shape to be render.
animationBooleantrueEnables or disables the slider animation while value change.
readOnlyBooleanfalseThis enables the control into the readOnly mode, so we can't interact with the control when readOnly enabled.
disabledBooleanfalseEnables or disables the control.
handleSizeString, Number"+0"The handleSize property mentions the size of the handle.
handleShapeString"round"The handleShape property mentions the shape of the handle.
showTooltipBooleantrueEnables or disables the tooltip inside the slider.
editableTooltipBooleantrueEnables the editable option of tooltip. When this property set as true, we can change the value by editing the tooltip.
keyboardActionBooleantrueEnables or disables the keyboard functionality.
mouseScrollActionBooleanfalseEnables or disables the mouse scroll functionality.
startValueNumbernullThis property decides at which point the slider should start. Otherwise, by default the slider starts with min value.

Events

Note: The event hanlders should be passed like v-bind:change="handler" or :change="handler" as same as the props, instead of v-on:. Since this acts like a wrapper of roundSlider, so the events will be treated as props.

namedescription
createThis event triggered after the control creation or initialization.
beforeValueChangeThis event will be triggered before the value change happens. And this event can be cancellable.
changeThis event triggered when the slider's value gets changed.
updateThis event triggered when the slider value updated such as during change as well as the handle drag. Simply it is the combination of "change" and "drag".
valueChangeThis event is similar to 'update' event, in addition it will trigger even the value was changed through programmatically also.
tooltipFormatThis event will act as a callback. So you can customize the tooltip template by returning with the custom values here.

Screenshots

Different appearances

vue-round-slider - colourful appearances

Different circle shapes

vue-round-slider - different circle shapes - pie shape, half or semi-circle, quarter and arc slider

License

MIT

Keywords

FAQs

Last updated on 03 Jul 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc