Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vlider

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vlider

Simple to use, highly customizable, and pretty vue js range slider

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Vlider

Input range component based on vue and custom CSS3. Highly customizable, pretty, and easy to use.

(Demo: https://kawishbit.github.io/vlider/)

Demo

Install Plugin

npm install --save vlider
<script>
    Import Vlider from "vlider"

    ...
    componenets: {
        Vlider
    }
    ...
</script>

<style>
    //import vlider in your CSS or SCSS file or directly in your Vue file
    
    @import "vlider/src/sass/vlider.scss";
    
    //or
    
    @import "vlider/dist/vlider.min.css";
</style>

Component Usage Example

<template>
    <vlider
    :id="'first'"
    :vlider-data="slider"
    :theme="'theme-dark'"
    v-model="inputRange"
    @click="vliderClick"
    >
        <template slot="bullet" slot-scope="bullet">
            <label>{{ bullet.data.label }}</label>
            <i
            class="em"
            :class="[`em-${bullet.data.extras.icon}`]"
            ></i> 
            <a target="_blank" :href="bullet.data.extras.learnMore">Learn more ?</a>
        </template>
    </vlider>
</template>
<script>
    import Vlider from "vlider";

    export default {
        name: "app",
        components: {
            Vlider
        },
        data() {
            return {
                inputRange: null,
                slider: [
                    {label: "Angry", color: "#ffc300", extras: { icon: 'angry', learnMore: 'http://localhost/'}},
                    {label: "Expressionless", color: "#ffb0fe", extras: { icon: 'expressionless', learnMore: 'http://localhost/'}},
                    {label: "Astonished", color: "#ff6bd6", extras: { icon: 'astonished', learnMore: 'http://localhost/'}},
                    {label: "Confounded", color: "#ff9d76", extras: { icon: 'confounded', learnMore: 'http://localhost/'}},
                    {label: "Okay?", color: "#51eaea", extras: { icon: 'face_with_raised_eyebrow', learnMore: 'http://localhost/'}},
                    {label: "Blush", color: "#fb3569", extras: { icon: 'blush', learnMore: 'http://localhost/'}}
                ]
            };
        },
        watch: {
            inputRange() {
                console.log(this.inputRange)
            }
        },
        methods: {
            vliderClick(value) {
                console.log(`clicked`)
                console.log(value)
            }
        }
    };
</script>
<style>
    @import "vlider/src/sass/vlider.scss"
</style>

Params

ParamDescription
idid of the vlider component
classesto add extra classes to the outer vlider container
themethere are 3 default themes : ("theme-dark", "theme-light", "theme-purple")
vlider-dataFormat : Create an array of objects, and you have to send label, color, and extras in every object, extras can be filled with anything you want and you can use the extras object using slot-scope like the above example

Events

EventDescription
v-modelv-model="yourVariable" //same usage like input v-model
click@click="yourMethodHere(value)" //you can take the clicked element's value by using $event or the first parameter of your method

Keywords

FAQs

Package last updated on 18 Jul 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc