FSAI Design System
Components

Range Slider

Controlled slider for continuous or discrete numeric adjustment, with optional drag tooltip.

Overview

RangeSlider is the shared slider control for numeric adjustment.

Use it when the interaction is better expressed as dragging across a range rather than typing into a field.

Common fits:

  • visual tuning controls
  • discrete density or count settings
  • percentage-style adjustments

Basic Usage

<RangeSlider
  min={0}
  max={100}
  value={cornerRadius}
  onChange={setCornerRadius}
  step={5}
  showValueInTooltip
  formatValue={(value) => `${value}%`}
/>

This mirrors the pattern used in QrTemplateModal.tsx.

Discrete Slider

Use discrete when the slider should snap to stepped values.

<RangeSlider
  min={1}
  max={4}
  value={columnCount}
  onChange={setColumnCount}
  discrete
  step={1}
  showValueInTooltip
  formatValue={(value) => `${value} columns`}
/>

This is the same pattern used by the data-table density control.

Props

PropTypeDefaultDescription
maxnumber100Maximum slider value.
valuenumberCurrent value.
onChange(value: number) => voidRequired. Called when the value changes.
minnumber0Minimum slider value.
direction'horizontal' | 'vertical''horizontal'Slider orientation.
trackColorstringblue tokenActive track color.
incompleteTrackColorstringgray tokenInactive track color.
handleColorstringOptional handle color override.
discretebooleanfalseEnables snapped stepped values.
stepnumberStep size, especially relevant in discrete mode.
notchLimitnumber5Caps the effective max when discrete mode is used.
invertedbooleanfalseReverses progress direction.
classNamestringAdditional wrapper classes.
trackSizenumber12Track thickness in pixels.
showValueInTooltipbooleanfalseShows the current value in a tooltip while dragging.
formatValue(value: number) => stringvalue.toFixed(2)Formats the tooltip label.

Brand Dashboard Usage

PatternPathNotes
QR style tuningfsai/apps/brand-dashboard/src/pages/StudioQrTemplates/QrTemplateModal.tsxContinuous percentage-style adjustment.
Data-table density controlfsai/packages/shared-ui/src/components/DataTable/toolbar/GridDensityToggle.tsxDiscrete snapped values with tooltip formatting.

Important Cautions

  • RangeSlider is fully controlled; the parent owns the value.
  • Discrete mode changes how step and notchLimit behave.
  • The value tooltip is only shown while dragging when showValueInTooltip is enabled.
  • This is a drag-oriented control, not a precise numeric-entry replacement.

Guidelines

  • Do use RangeSlider for tuning-style numeric controls
  • Do use discrete when only stepped values make sense
  • Do provide formatValue when the raw number is not user-friendly
  • Don't use RangeSlider when the user needs exact freeform numeric entry more than quick adjustment

On this page