MCPcopy Index your code
hub / github.com/Stryzhevskyi/rangeSlider

github.com/Stryzhevskyi/rangeSlider @0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.5.0 ↗ · + Follow
55 symbols 95 edges 5 files 6 documented · 11% updated 3mo ago0.5.0 · 2026-03-21★ 1784 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

rangeSlider

Simple, small and fast vanilla JavaScript polyfill for the HTML5 <input type="range"> slider element. Forked from André Ruffert's jQuery plugin

Check out the examples.

  • Touchscreen friendly
  • Recalculates onresize
  • Small and fast
  • Supports all major browsers
  • Buffer progressbar (for downloading progress etc.)

Install

Install with npm:

npm install --save rangeslider-pure

Usage

// Initialize a new plugin instance for one element or NodeList of elements.
const slider = document.querySelector('input[type="range"]');
rangeSlider.create(slider, {
    polyfill: true,     // Boolean, if true, custom markup will be created
    root: document,
    rangeClass: 'rangeSlider',
    disabledClass: 'rangeSlider--disabled',
    fillClass: 'rangeSlider__fill',
    bufferClass: 'rangeSlider__buffer',
    handleClass: 'rangeSlider__handle',
    startEvent: ['mousedown', 'touchstart', 'pointerdown'],
    moveEvent: ['mousemove', 'touchmove', 'pointermove'],
    endEvent: ['mouseup', 'touchend', 'pointerup'],
    vertical: false,    // Boolean, if true slider will be displayed in vertical orientation
    min: null,          // Number, 0
    max: null,          // Number, 100
    step: null,         // Number, 1
    value: null,        // Number, center of slider
    buffer: null,       // Number, in percent, 0 by default
    stick: null,        // [Number stickTo, Number stickRadius] : use it if handle should stick to ${stickTo}-th value in ${stickRadius}
    borderRadius: 10,   // Number, if you're using buffer + border-radius in css
    onInit: function () {
        console.info('onInit')
    },
    onSlideStart: function (position, value) {
        console.info('onSlideStart', 'position: ' + position, 'value: ' + value);
    },
    onSlide: function (position, value) {
        console.log('onSlide', 'position: ' + position, 'value: ' + value);
    },
    onSlideEnd: function (position, value) {
        console.warn('onSlideEnd', 'position: ' + position, 'value: ' + value);
    }
});

// update position
const triggerEvents = true; // or false
slider.rangeSlider.update({
    min: 0,
    max: 20,
    step: 0.5,
    value: 1.5,
    buffer: 70
}, triggerEvents);

<input
    type="range"
    min="0"
    max="100"
    step="1"
    data-buffer="60" />

Internal APIs:

/*
 * @see src/utils/dom.js
 */
RangeSlider.dom;
/*
 * @see src/utils/functions.js
 */
RangeSlider.functions;
RangeSlider.version;

Use the JSFiddle template for issues.

Alternative template on StackBlitz.

License

MIT

Core symbols most depended-on inside this repo

s4
called by 8
src/utils/functions.js
_updatePercentFromValue
called by 4
src/range-slider.js
_setPosition
called by 4
src/range-slider.js
_update
called by 3
src/range-slider.js
_getPositionFromValue
called by 3
src/range-slider.js
_setValue
called by 3
src/range-slider.js
_toFixed
called by 2
src/range-slider.js
_setBufferPosition
called by 2
src/range-slider.js

Shape

Function 28
Method 25
Class 2

Languages

TypeScript100%

Modules by API surface

src/range-slider.js27 symbols
src/utils/dom.js17 symbols
src/utils/functions.js11 symbols

For agents

$ claude mcp add rangeSlider \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page