JSPM

  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q56535F
  • License MIT

Slider component

Package Exports

  • slidy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (slidy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

slidy

Range slider component. Tests.

Usage

$ npm install slidy

var Slidy = require('slidy');

var slidy = new Slidy({
    min: 0,
    max: 100,
    value: 12
});

document.body.appendChild(slidy.element);

Slidy API

Name Description
Slidy.prototype.min Minimum value.
Slidy.prototype.max Maximum value.
Slidy.prototype.value Picker value. In case of multiple pickers - first picker's value.
Slidy.prototype.type Type of pickers placement, see Picker.prototype.type.
Slidy.prototype.repeat Repeat picker by axis: x, y or both,
Slidy.prototype.pickers List of picker instances. Can be passed to options as a list of options for each picker. Slidy({pickers: [{value:0}, {value: 1}, ...] })
Slidy.prototype.pickerClass Class to add to each picker.
Slidy.prototype.getClosestPicker(x, y) Get picker closest to the relative x, y coordinates within the slidy container.
Slidy.prototype.update() Update all pickers sizes and positions according to their values.
Slidy.prototype.step Round value to the step. Can be a function, accepting value and returning rounded value.
Slidy.prototype.snap Whether to move thumb loosely so that it is snapped only when released.

Picker API

Name Description
Picker.prototype.min Minimum value.
Picker.prototype.max Maximum value.
Picker.prototype.value Current value of a picker.
Picker.prototype.type Type of placement - 'horizontal', 'vertical', 'rectangular', 'circular'.
Picker.prototype.repeat Repeat picker by one of axis: x, y or both.
Picker.prototype.move(x, y) Move picker to relative x, y coordinates, update value.
Picker.prototype.startDrag() Start dragging for the picker.
Picker.prototype.update() Update size and position according to the value.

NPM