Slider

Slider control allows users to select a specific value or a range of values from a set. Usually, slider presents a relatively large dataset and the way that the user interacts with it is helpful to explore the multiple options swiftly.

Props

NameDefaultDescription
defaultValue: numberInitial value of the slider, only when it is uncontrolled.
value: numberThe selected value. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
label: stringText to be placed above the slider.
name: stringName attribute of the input element.
helperText: stringHelper text to be placed above the slider.
minValue: number0The minimum value available for selection.
maxValue: number100The maximum value available for selection.
step: number1The step interval between values available for selection.
showLimitsValues: booleanfalseWhether the min/max value labels should be displayed next to the slider.
showInput: booleanfalseWhether the input element for displaying/controlling the slider value should be displayed next to the slider.
disabled: booleanfalseIf true, the component will be disabled.
marks: booleanfalseWhether the marks between each step should be shown or not.
onChange: functionThis function will be called when the slider changes its value, as it's being dragged. The new value will be passed as a parameter when this function is executed.
onDragEnd: functionThis function will be called when the slider changes its value, but only when the thumb is released. The new value will be passed as a parameter when this function is executed.
labelFormatCallback: functionThis function will be used to format the labels displayed next to the slider. The value will be passed as parameter and the function must return the formatted value.
margin: string | objectSize of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge'). You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
size: string'fillParent'Size of the component ('medium' | 'large' | 'fillParent').
tabIndex: number0Value of the tabindex attribute.
ref: objectReference to the component.

Examples

Controlled

Uncontrolled

Format label