npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

afix-range-slider

v1.3.7

Published

An accessible and flexible range slider web component

Downloads

20

Readme

Range Slider

An accessible and flexible range slider web component.

Using it

Via a script tag,

<script src="https://cdn.skypack.dev/afix-range-slider@latest" type="module"></script>

Or install with

npm install afix-range-slider

And use like this

import "afix-range-slider"`

<afix-range-slider value="50" min="25" max="75" />

Browser Support

This component depends on the following features.

All modern browsers have supported these features for some time. If you need IE support you will need to look elsewhere.

Attributes

| Name | Type | Description | | ------------------ | --------------- | -------------------------------------------------------------------------------------------------------------- | | value | number | The current value of the input | | shadow-value | number | A secondary value shown with the value. color should be set to something semi-transparent with this setting. | | min | number | The minimum permitted value | | max | number | The maximum permitted value | | step | number | The stepping interval, used both for user interface and validation purposes | | position-indicator | bar or line | The style of the position indicator, either a solid bar or a line. | | horizontal | boolean | The input should be displayed horizontally. Vertical by default |

CSS Custom Properties

Remember all custom properties are prefixed with the component name. e.g. background-color is --afix-range-slider-background-color.

| Name | Default | Description | | ---------------------- | ---------------------------------- | ---------------------------------------------------- | | track-background-color | currentColor | The track color | | track-background-image | none | The background-image for the track | | track-line-color | none | The color of the line when position-indicator="line" | | width | 3.75rem vertical, 12rem horizontal | Width of the range | | height | 10rem vertical, 3.75rem horizontal | Height of the range | | background-color | rgba(0, 0, 0, 0.8) | background-color for the range element | | background-image | none | background-image for the range element | | border | none | border for the range element |

Events

change

A MessageEvent where the shape of data conforms to the following interface:

interface RangeSliderChange {
  // Good for presenting to the user - The boundedValue to a fixed number of places based on the step attribute.
  value: number;
  // Good for using in calculations, more precise than value - the raw input value after minmax(value)
  rawValue: number;
}