Skip to main content

SliderProps

The SliderProps object is used to render a slider.

note

This type is deducted from Spotify's internal usage. It may not be accurate and may change in the future.

type SliderProps = {
value: number;
max: number;
step: number;
labelText?: string;
isInteractive?: boolean;
forceActiveStyles?: boolean;
onDragStart: (value: number) => void;
onDragMove: (value: number) => void;
onDragEnd: (value: number) => void;
onStepForward?: (value: number) => void;
onStepBackward?: (value: number) => void;
}

Properties

PropertyTypeDescription
valuenumberThe current value of the slider.
maxnumberThe maximum value the slider can have.
stepnumberThe increment/decrement value when the slider is moved.
labelTextstring | undefinedThe label text displayed for the slider.
isInteractiveboolean | undefinedDetermines if the slider is interactive.
forceActiveStylesboolean | undefinedForces the active styles regardless of interaction state.
onDragStart(value: number) => voidCallback function when dragging starts.
onDragMove(value: number) => voidCallback function when the slider is being dragged.
onDragEnd(value: number) => voidCallback function when dragging ends.
onStepForward(value: number) => void | undefinedCallback function when the slider steps forward. Deprecated.
onStepBackward(value: number) => void | undefinedCallback function when the slider steps backward. Deprecated.