1.3.7 • Published 4 years ago

afix-range-slider v1.3.7

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

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

NameTypeDescription
valuenumberThe current value of the input
shadow-valuenumberA secondary value shown with the value. color should be set to something semi-transparent with this setting.
minnumberThe minimum permitted value
maxnumberThe maximum permitted value
stepnumberThe stepping interval, used both for user interface and validation purposes
position-indicatorbar or lineThe style of the position indicator, either a solid bar or a line.
horizontalbooleanThe 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.

NameDefaultDescription
track-background-colorcurrentColorThe track color
track-background-imagenoneThe background-image for the track
track-line-colornoneThe color of the line when position-indicator="line"
width3.75rem vertical, 12rem horizontalWidth of the range
height10rem vertical, 3.75rem horizontalHeight of the range
background-colorrgba(0, 0, 0, 0.8)background-color for the range element
background-imagenonebackground-image for the range element
bordernoneborder 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;
}
1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago