Documentation
Feedback
Guides
Storefront Development

Storefront Development
Storefront development

Slider

Sliders allow users to select a single value from a range.

The Slider component provides an interactive way for users to select a single value from a defined range. Common use cases include adjusting prices, setting volume, or selecting values where precision within boundaries matters.
Example
Code
0500

Usage

Import the component


_10
import { Slider } from "@faststore/ui";

Import Styles into your FastStore project

To apply styles, include the following in your stylesheet:

_10
@import "@faststore/ui/src/components/atoms/Slider/styles.scss";


Examples

Slider with custom step

Example
Code
050

Accessible Slider with aria-value-text

Example
Code
050

Slider with custom value labels

Example
Code
0100
10 kg90 kg

Design tokens

Local tokenDefault value/Global token linked
--fs-slider-heightvar(--fs-spacing-2)
--fs-slider-border-radiusvar(--fs-border-radius-pill)
--fs-slider-margin-bottomvar(--fs-spacing-3)
--fs-slider-slider-bkg-color
var(--fs-color-neutral-bkg)
--fs-slider-slider-selection-bkg-color
var(--fs-color-primary-bkg-light-active)
--fs-slider-transition-functionvar(--fs-transition-function)
--fs-slider-transition-propertyvar(--fs-transition-property)
--fs-slider-transition-timingvar(--fs-transition-timing)

Design tokens: Thumb

Thumb tokens control the appearance of the slider's draggable handle, including its size, color, border, and hover states.
Local tokenDefault value/Global token linked
--fs-slider-thumb-sizevar(--fs-spacing-4)
--fs-slider-thumb-bkg-color
var(--fs-color-primary-bkg)
--fs-slider-thumb-bkg-color-hover
var(--fs-color-primary-bkg-hover)
--fs-slider-thumb-border-widthvar(--fs-border-width)
--fs-slider-thumb-border-radiusvar(--fs-border-radius-circle)
--fs-slider-thumb-border-color
var(--fs-slider-thumb-bkg-color)
--fs-slider-thumb-border-color-hover
var(--fs-slider-thumb-bkg-color-hover)

Design tokens: Absolute values

Absolute value tokens define the color for the labels showing the minimum and maximum values on the slider.
Local tokenDefault value/Global token linked
--fs-slider-absolute-values-text-color
var(--fs-color-disabled-text)

Design tokens: Value label

Value label tokens set the position and background color for the labels displaying the current slider value.
Local tokenDefault value/Global token linked
--fs-slider-value-label-bottomvar(--fs-spacing-3)
--fs-slider-value-label-bkg-color
var(--fs-color-body-bkg)

Data attributes

You can target and override Slider styles using the following data attributes:
data-fs-slider
data-fs-slider-absolute-values
data-fs-slider-range
data-fs-slider-thumb="left" | "right"
data-fs-slider-value-label="min" | "max"

Props

Range

NameTypeDescriptionDefault
absolutenumberThe absolute value of the slider.
selectednumberThe selected value of the slider.

RangeLabel

NameTypeDescriptionDefault
minstring | ReactNodeLabel for minimum range value.
maxstring | ReactNodeLabel for maximum range value.

Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
Was this helpful?
Suggest edits (GitHub)
On this page