Git Product home page Git Product logo

v-range-flyout's Introduction

v-range-flyout npm version License: MIT

Range Flyout

A vue component that wraps a input type=number with a customizable range slider flyout.

Live Demo

Installation

npm i --save v-range-flyout

Initialize in main.js

import rangeFlyout from "v-range-flyout";
Vue.use(rangeFlyout);

Options (element attributes)

  • v-model or value : Number - Required. String values will be converted to Number.
  • min: Number - Required
  • max: Number - Required
  • disabled: Boolean - Disable the control
  • sliderHeight: Number - Optionally set the height of the slideable area of the flyout.
  • incr: Number - Optionally set value increment (step attribute in input[type=number]) the control should snap to a multiple of.
  • slideBackground: String - used to show color scales as gradients.
  • inputClass: String - Optional css class to add to the input element
  • flyoutClass: String - Optional wrapper class for the flyout wrapper div

Events

  • @input: Fires on keyboard or slider input
  • @change: Fires when value changes and control is no longer in focus. Returns the numeric value.
  • @active: Fires when flyout is toggled or input changes focus state. A boolean is passed to indicate "active" state.

Usage Examples

<template>
  <div class="wrap">
    <div class="control">
      <label>Choose a value between -50 and 50</label>
      <range-flyout :min="-50" :max="50" v-model="chosenVal"/>
    </div>
    <p>You chose: {{chosenVal}}</p>
  </div>
</template>
<script>
export default {
  data:() => { return {chosenVal:50} }
}
</script>
<style lang="scss">
.wrap{
  .control{
    display: inline-block;
    padding:12px;
    margin-right:50px;
    label{
      display:block;
    }
  }
}
</style>

Disclaimer

This is in active development. Stability not guaranteed. Please file github issues for bugs/features.

v-range-flyout's People

Contributors

thewebkid avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.