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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@alekstar79/range-slider

v1.0.1

Published

A modern, TypeScript-first range slider with single and double handles, keyboard support, skin.

Readme

Range Slider

npm version node license coverage

Range Slider

LIVE DEMO

A modern, TypeScript-first range slider for single and double selection, built for today’s web applications without jQuery or legacy browser shims.

It provides a polished interaction model, flexible configuration, keyboard accessibility, built-in skins, and a small, ergonomic API for integration into any UI.

Features

  • Single and double-handle modes
  • Pointer and keyboard interaction
  • Built-in skins: flat, round, big, sharp, square, and modern
  • Optional min/max labels, from/to labels, and grid ticks
  • Custom formatting and prettified values
  • Works with standalone containers or native input elements
  • No jQuery dependency and no IE compatibility layer

Installation

npm install @alekstar79/range-slider

Quick start

import { createRangeSlider } from '@alekstar79/range-slider'
import '@alekstar79/range-slider/style.css'

const host = document.getElementById('slider')

if (host) {
  createRangeSlider(host, {
    type: "double",
    min: 0,
    max: 100,
    from: 20,
    to: 80,
    step: 5,
    skin: "round",
    grid: true,
  })
}
<div id="slider"></div>

Usage with an input element

The library can also decorate a native input and keep it in sync with the slider state:

<input id="price" type="text" value="25;75" />
import { createRangeSliderFromInput } from '@alekstar79/range-slider'
import '@alekstar79/range-slider/style.css'

const input = document.getElementById('price') as HTMLInputElement

createRangeSliderFromInput(input, {
  type: "double",
  min: 0,
  max: 100,
  skin: "modern",
  grid: true,
})

Common options

| Option | Type | Default | Description | |----------------------|-----------------------------|--------------|----------------------------------------------| | type | 'single' \| 'double' | 'single' | Selects one or two handles. | | min / max | number | 10 / 100 | Defines the slider range. | | from / to | number | 10 / 100 | Initial handle positions. | | step | number | 1 | Step size for pointer and keyboard movement. | | skin | string | 'flat' | Chooses the visual theme. | | grid | boolean | false | Shows tick marks. | | keyboard | boolean | true | Enables arrow key navigation. | | hide_min_max | boolean | false | Hides the min/max labels. | | hide_from_to | boolean | false | Hides the from/to labels. | | prefix / postfix | string | '' | Adds visual decoration to values. | | valueFormatter | (value: number) => string | null | Custom formatter for labels. | | disable / block | boolean | false | Locks interaction. |

Events and instance API

The slider instance exposes a compact API for updates and event handling:

import { createRangeSlider } from '@alekstar79/range-slider'

const slider = createRangeSlider(host, { type: 'single' })

slider.on('change', (result) => {
  console.log(result.from, result.to)
})

slider.update({ skin: 'sharp', from: 42 })
slider.destroy()

Supported events:

  • start
  • change
  • finish
  • update

Demo

A local demo is included in the package sources and can be launched with:

npm run dev

Development

npm install
npm test
npm test:coverage
npm run build

License

This project is released under the MIT License. See LICENSE