Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
vue-custom-range-slider
Advanced tools
Readme
This is a simple vue-range slider, that supports custom values, labels and more. The component is based on use with v-model, the value is always a string, for supporting custom values.
See the slider in action, in this codesandbox
npm install --save vue-custom-range-slider
yarn add vue-custom-range-slider
<template>
<div>
<custom-slider min="10" max="50" step="2" raising v-model="slider" />
{{ slider }}
</div>
</template>
<script>
import CustomSlider from "vue-custom-range-slider";
// import the styling, css or scss
import "vue-custom-range-slider/dist/vue-custom-range-slider.css";
export default {
components: {
CustomSlider
},
data() {
return {
slider: "12"
};
}
};
</script>
<template>
<div>
<custom-slider :values="sliderValues" raising v-model="slider" />
{{ slider }}
</div>
</template>
<script>
import CustomSlider from "vue-custom-range-slider";
// import the styling, css or scss
import "vue-custom-range-slider/dist/vue-custom-range-slider.css";
export default {
components: {
CustomSlider
},
data() {
return {
slider: "a",
sliderValues: [
{
label: "Not at all",
value: "a"
},
{
label: "A tiny bit",
value: "b"
},
{
label: "Its ok",
value: "c"
},
{
label: "Its very good",
value: "d"
},
{
label: "Its AMAZING!",
value: "e"
}
]
};
}
};
</script>
All properties are optional
Property | Description | Type | Default |
---|---|---|---|
values | Pass an array of custom values, with corresponding labels (overrides min/max) | array | [] |
min | Sets the minimum value of the slider | string | '0' |
max | Sets the maximum value of the slider | string | '100' |
step | Sets the stepping interval | string | '1' |
hideLabel | Set, if you want to hide the label above the slider | boolean | false |
raising | Set if you want a "raising" shape, like: ◁ | boolean | false |
Name | Description | Type |
---|---|---|
change | Emits the current value on change | string |
You can easily modify the look of the slider, by overriding the variables in the scss file.
// override variables like this:
$label-color: red;
// import the styling,
@import "vue-custom-range-slider/dist/vue-custom-range-slider.scss";
All variables can be found in the scss file
If you have suggestions for improvements, dont hesitate to make an issue or pull request. :)
MIT
FAQs
Slider component for vue, with support for custom values
The npm package vue-custom-range-slider receives a total of 248 weekly downloads. As such, vue-custom-range-slider popularity was classified as not popular.
We found that vue-custom-range-slider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.