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

elegans-slider

v0.1.1

Published

A tactile React range control with a liquid thumb.

Readme

Slider

A tactile React range control with a liquid thumb.

Slider works with React 18.2 and newer. It supports track clicks, dragging, keyboard input, touch, dark mode and reduced motion. Double-clicking the thumb returns it to the configured reset value. Reaching the maximum value gives the rail one restrained completion shimmer.

Install

npm install elegans-slider

Use it

"use client"

import { useState } from "react"
import { Slider } from "elegans-slider"

export function Example() {
  const [value, setValue] = useState(50)

  return (
    <Slider
      label="Intensity"
      value={value}
      onValueChange={setValue}
      resetValue={50}
    />
  )
}

value and onValueChange make this a controlled component. Your application owns the current value.

Response 50%, Bounce 3% and Stretch 60% are the approved playground defaults. Use move only when you want to tune the feel.

Props

| Prop | Type | Required | Purpose | | --- | --- | --- | --- | | value | number | Yes | Current value. | | onValueChange | (value) => void | Yes | Runs when the value changes. | | label | string | Yes | Accessible name for the slider. | | min | number | No | Minimum value. Defaults to 0. | | max | number | No | Maximum value. Defaults to 100. | | step | number | No | Value interval. Defaults to 1. | | resetValue | number | No | Value restored by double-clicking the thumb. | | formatValue | (value) => string | No | Formats the floating value label and accessible value text. | | showValueTooltip | boolean | No | Shows the floating value label. Defaults to true. | | showMaxGlint | boolean | No | Shows the completion shimmer at the maximum value. Defaults to true. | | size | "default" \| "compact" | No | Uses the standard or compact thumb. | | move | SliderMoveOptions | No | Adjusts response, bounce and stretch. | | className | string | No | Adds a class to the outer element. |

Native range-input attributes such as disabled, name and aria-describedby are also supported.

Styling

The component imports its own CSS. Override these variables on the component or an ancestor to fit it into an existing design system:

.my-slider {
  --liquid-slider-thumb: #171717;
  --liquid-slider-rail: #d8d8d8;
  --liquid-slider-rail-glint: rgba(255, 255, 255, 0.68);
  --liquid-slider-value-surface: #ececec;
  --ink-primary: #171717;
  --focus-ring: #171717;
}

The component follows a surrounding data-theme="light" or data-theme="dark" attribute. Without one, it follows the operating system's colour preference.

Accessibility

  • The native range input preserves arrow-key, Home, End and assistive-technology support.
  • The visible focus ring appears for keyboard users without appearing on pointer clicks.
  • The thumb keeps a larger invisible hit area for touch and mouse input.
  • prefers-reduced-motion removes spatial transitions.
  • label and the formatted value are exposed to assistive technology.

Licence

MIT