Skip to main content
Version: Next

Slider

Sliders allow users to select a value from a fixed set of values using drag utility.

Usage#


Props#

Slider#

Reference#

Slider#

allowTouchTrack#

If true, thumb will respond and jump to any touch along the track.

TypeDefault
booleanfalse

animateTransitions#

Set to true if you want to use the default 'spring' animation.

TypeDefault
booleanNone

animationConfig#

Used to configure the animation parameters. These are the same parameters in the Animated library.

TypeDefault
TimingAnimationConfig or SpringAnimationConfigNone

animationType#

Set to 'spring' or 'timing' to use one of those two types of animations with the default animation properties.

TypeDefault
"timing" or "spring"timing

containerStyle#

Apply style to the container of the slider.

TypeDefault
Style ObjectNone

debugTouchArea#

Set this to true to visually see the thumb touch rect in green.

TypeDefault
booleanfalse

disabled#

If true the user won't be able to move the slider.

TypeDefault
booleanNone

maximumTrackTintColor#

The color used for the track to the right of the button.

TypeDefault
string#b3b3b3

maximumValue#

Initial maximum value of the slider.

TypeDefault
number1

minimumTrackTintColor#

The color used for the track to the left of the button.

TypeDefault
string#3f3f3f

minimumValue#

Initial minimum value of the slider.

TypeDefault
number0

onSlidingComplete#

Callback called when the user finishes changing the value (e.g. when the slider is released).

TypeDefault
(value: number) => voidNone

onSlidingStart#

Callback called when the user starts changing the value (e.g. when the slider is pressed).

TypeDefault
(value: number) => voidNone

onValueChange#

Callback continuously called while the user is dragging the slider.

TypeDefault
(value: number) => voidNone

orientation#

Set the orientation of the slider.

TypeDefault
"vertical" or "horizontal"horizontal

step#

Step value of the slider. The value should be between 0 and maximumValue - minimumValue).

TypeDefault
number0

style#

The style applied to the slider container.

TypeDefault
View style(Object)None

thumbProps#

The props applied to the thumb. Uses Component prop which can accept Animated components.

TypeDefault
anyNone

thumbStyle#

The style applied to the thumb.

TypeDefault
View style(Object)None

thumbTintColor#

The color used for the thumb.

TypeDefault
stringred

thumbTouchSize#

The size of the touch area that allows moving the thumb. The touch area has the same center as the visible thumb. This allows to have a visually small thumb while still allowing the user to move it easily.

TypeDefault
Sizable{ width: THUMB_SIZE, height: THUMB_SIZE }

trackStyle#

The style applied to the track.

TypeDefault
View style(Object)None

value#

Initial value of the slider.

TypeDefault
number0