Gathering detailed insights and metrics for @sawyerclick/svelte-range-slider-pips
Gathering detailed insights and metrics for @sawyerclick/svelte-range-slider-pips
Gathering detailed insights and metrics for @sawyerclick/svelte-range-slider-pips
Gathering detailed insights and metrics for @sawyerclick/svelte-range-slider-pips
Multi-Thumb, Accessible, Beautiful Range Slider with Pips
npm install @sawyerclick/svelte-range-slider-pips
Typescript
Module System
Node Version
NPM Version
TypeScript (62.62%)
Svelte (27.69%)
CSS (7.14%)
JavaScript (1.37%)
HTML (0.81%)
Vue (0.38%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MPL-2.0 License
495 Stars
269 Commits
45 Forks
5 Watchers
2 Branches
8 Contributors
Updated on Jul 12, 2025
Latest Version
2.2.0
Package Id
@sawyerclick/svelte-range-slider-pips@2.2.0
Unpacked Size
224.94 kB
Size
44.61 kB
File Count
7
NPM Version
8.19.3
Node Version
16.19.1
Published on
Jun 06, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A reactive, accessible, multi-thumb, range slider with the ability to display "pips" or "notches" along the range.
Importable as a svelte-component, or used directly in any javascript application.
📔 | Docs | Full Documentation & Examples |
---|---|---|
📦 | NPM | Node Module details |
📝 | REPL | Svelte component demo |
❤ | Codepen | Plain JS component demo |
Open your project and use the command line to install the package;
1yarn add svelte-range-slider-pips --dev # or 2npm install svelte-range-slider-pips --save-dev # if you prefer npm
Assuming you have a Svelte app up and running;
1<script> 2 import RangeSlider from "svelte-range-slider-pips"; 3</script> 4 5<RangeSlider values={[50]} pips />
If you're not building a svelte-app, you can use the /dist/
version of the script /dist/svelte-range-slider-pips.js
and include it
with a regular <script>
tag. This should even work with jQuery.
1<script src="./js/vendor/svelte-range-slider-pips.js" /> 2 3<div id="my-slider"></div> 4 5<script> 6 var mySlider = new RangeSliderPips({ 7 target: document.querySelector("#my-slider"), 8 props: { values: [50], pips: true } 9 }); 10</script>
If you're building a bleeding-edge JS application (maybe Vue or React), you might
want to use js imports (import
)
1import RangeSlider from "./node_modules/svelte-range-slider-pips/dist/svelte-range-slider-pips.mjs";
2
3var mySlider = new RangeSlider({
4 target: node, // js reference to a DOM element
5 props: { values: [50], pips: true }
6});
prop | type | default | description |
---|---|---|---|
values | Array | [50] | Array of values to apply on the slider. Multiple values creates multiple handles. (note: A slider with range property set can only have two values max) |
min | Number | 0 | Minimum value for the slider (should be < max ) |
max | Number | 100 | Maximum value for the slider (should be > min ) |
step | Number | 1 | Every nth value to allow handle to stop at (should be a positive value) |
range | Boolean /String | false | Whether to style as a range picker. Use range='min' or range='max' for min/max variants |
pushy | Boolean | false | If range is true , then this boolean decides if one handle will push the other along |
float | Boolean | false | Set true to add a floating label above focussed handles |
vertical | Boolean | false | Make the slider render vertically (lower value on bottom) |
pips | Boolean | false | Whether to show pips/notches on the slider |
pipstep | Number | 1 /10 /20 | Every nth step to show a pip for. This has multiple defaults depending on values property |
first | Boolean /String | false | Whether to show a pip or label for the first value on slider. Use first='label' to show a label value |
last | Boolean /String | false | Whether to show a pip or label for the last value on slider. Use last='label' to show a label value |
rest | Boolean /String | false | Whether to show a pip or label for all other values. Use rest='label' to show a label value |
all | Boolean /String | false | Whether to show a pip or label for all values. Same as combining first , last and rest . Use all='label' to show a label value |
prefix | String | "" | A string to prefix to all displayed values |
suffix | String | "" | A string to suffix to all displayed values |
reversed | Boolean | false | Reverse the orientation of min/max |
hoverable | Boolean | true | Whether hover styles are enabled for both handles and pips/values |
disabled | Boolean | false | Determine if the slider is disabled, or enabled (only disables interactions, and events) |
id | String | "" | Give the slider a unique ID for use in styling |
formatter | Function | (v,i,p) => v | A function to re-format values before they are displayed (v = value, i = pip index, p = percent ) |
handleFormatter | Function | formatter | A function to re-format values on the handle/float before they are displayed. Defaults to the same function given to the formatter property (v = value, i = handle index, p = percent ) |
springValues | Object | { stiffness: 0.15, damping: 0.4 } | Svelte spring physics object to change the behaviour of the handle when moving |
slider | Element | undefined | DOM reference for binding to the main <div /> of the component (bind:slider='ref' ) |
event | example | event.detail | description |
---|---|---|---|
start | on:start={(e) => { ... }} | { activeHandle: Integer, value: Float, values: Array } | Event fired when the user begins interaction with the slider |
change | on:change={(e) => { ... }} | { activeHandle: Integer, startValue: Float, previousValue: Float, value: Float, values: Array } | Event fired when the user changes the value; returns the previous value, also |
stop | on:stop={(e) => { ... }} | { activeHandle: Integer, startValue: Float, value: Float, values: Array } | Event fired when the user stops interacting with slider; returns the beginning value, also |
📔📘📖 Full Documentation & Examples
Styling should mostly be done with CSS.
There's a bunch of css variables for controlling the colors of the elements.
And the slider is fluid horizontally, with the size of things controlled by font-size. So you may change the font-size
on the .rangeSlider
base
element to change the scale of everything.
If you require more fine control of the widths, heights, etc, then you may override the default css. This can be easier by using the id
prop
to give your slider a unique id.
Values of labels can be styled with CSS, and the format can be modified with the formatter()
function prop. And animation of the handles is
controlled by the springValues
object prop.
I am very happy to accept;
I'd be super excited if you find this project useful and wish to donate a small amount for my efforts!
![]() | ![]() | £1 GBP donation |
![]() | ![]() | £5 GBP donation |
![]() | ![]() | £10 GBP donation |
No vulnerabilities found.
Reason
25 commit(s) and 11 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
39 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More