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

svelte-range-slider-pips

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-range-slider-pips

Multi-Thumb, Accessible, Beautiful Range Slider with Pips

  • 1.3.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Svelte Range Slider (with pips)

svelte-range-slider-pips @ npm

A reactive, accessible, multi-thumb, range slider for use in a svelte application; with the ability to display "pips" or "notches" along the range.

Image of the Svelte Range Slider, set as focussed, including some pips

🔗 For full documentation and examples, see the Github Pages


install

Open your project and use the command line to install the package;

yarn add --dev svelte-range-slider-pips         # or
npm install --save-dev svelte-range-slider-pips # if you prefer npm

usage

Assuming you have a Svelte app up and running;

<script>
  import RangeSlider from "svelte-range-slider-pips";
</script>

<RangeSlider />

props (options)

slider props

proptypedefaultdescription
valuesArray[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)
minNumber0Minimum value for the slider
maxNumber100Maximum value for the slider
stepNumber1Every nth value to allow handle to stop at
rangeBoolean/StringfalseWhether to style as a range picker. Use range='min' or range='max' for min/max variants
floatBooleanfalseSet true to add a floating label above focussed handles
verticalBooleanfalseMake the slider render vertically
pipsBooleanfalseWhether to show pips/notches on the slider
pipStepNumber1/10/20Every nth step to show a pip for. This has multiple defaults depending on values property
firstBoolean/StringfalseWhether to show a pip or label for the first value on slider. Use first='label' to show a label value
lastBoolean/StringfalseWhether to show a pip or label for the last value on slider. Use last='label' to show a label value
restBoolean/StringfalseWhether to show a pip or label for the all other values. Use rest='label' to show a label value
prefixString""A string to prefix to all displayed values
suffixString""A string to suffix to all displayed values
formatterFunction(v) => vA function to re-format values before they are displayed
handleFormatterFunctionformatterA function to re-format values on the handle/float before they are displayed. Defaults to the same function given to the formatter property
springValuesObject{ stiffness: 0.15, damping: 0.4 }Svelte spring physics object to change the behaviour of the handle when moving

🔗 For full documentation and examples, see the Github Pages

contribue

I am very happy to accept;

  • suggestions/requests for new features or changes with examples of how they would be useful
  • pull-requests for bug fixes, or issue resolution
  • help with creating a proper test-suite

When making changes/edits to the code you should use the /test/ folder and check the Readme.md in there to help with testing all the functionality. I don't have real tests set up, and would appreciate anyone's help who knows how to accomplish that.

Keywords

FAQs

Package last updated on 05 Sep 2020

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