Skip to content
Storybook

Slider

Single value or range slider with label and live value.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

60%

Usage

  • Use for approximate values. For exact numbers add an Input.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Range

Two inputs share one rail.

Price range

Disabled

Volume

API reference

Class / attributeTypeDescription
px-sliderclassHost; data-format="{v}%" formats the output.
px-slider__rail · __fillclassTrack and fill (set by JS).
input[type=range]elementOne for Single, two for Range.

Figma properties

Slider16 variants · page “Sliders”Open

Single value or range slider with label and live value. Thumbs are 20px (44px touch target in code via padding). RTL fills from the right; use arrow keys ±1 step, Page Up/Down ±10%. role=slider with a…

PropertyTypeValues
LabelText“Price range”
Show labelBoolean—
TypeVariantSingle Range
StateVariantActive Hover Focused Disabled
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-slider-track-heightspacing-88px
--px-slider-thumb-sizespacing-2020px

Accessibility

  • Native range: arrow keys ±1, Page Up/Down ±10%.
  • Each thumb needs a label.