Skip to main content

Slider

A range input for selecting a numeric value within a given range.

Basic Usage

With Value Label

40

Variants

60
60

Sizes

Custom Range and Step

25

Gradient fill

Set gradient to use the brand gradient as the track fill.

60
Browser limitation

gradient only renders in Firefox. WebKit (Safari, Chrome, Edge) shows the solid --tui-primary color because range-input pseudo-elements don't support background-image. The feature is progressive enhancement — non-Firefox users still get a fully functional slider, just without the gradient.

Mobile considerations

  • Thumb is sized to a 24px minimum on pointer:coarse so it's grabbable with a finger.
  • Touch drag works natively — no extra wiring needed.
  • Pair with showValue on mobile so the user gets immediate numeric feedback (no hover-to-see-value).

Disabled

Props

PropTypeDefaultDescription
valuenumber-Controlled value
defaultValuenumber-Default value (uncontrolled)
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Step increment
onChange(value: number) => void-Change callback
variant'primary' | 'secondary''primary'Color variant
size'sm' | 'md' | 'lg''md'Size
showValuebooleanfalseShow the current value label
gradientbooleanfalseGradient track fill (Firefox only — WebKit shows solid color)
disabledbooleanfalseWhether the slider is disabled
classNamestring-Additional CSS class
styleCSSProperties-Inline styles