DocumentationAPI Reference

API Reference

Props

Core Props

PropTypeRequiredDefaultDescription
progressAnimated.SharedValue<number>0Current value of the slider
minimumValueAnimated.SharedValue<number>-Minimum value of the slider
maximumValueAnimated.SharedValue<number>-Maximum value of the slider
cacheAnimated.SharedValue<number>-0Cache value for the slider (useful for video/audio players)
bubble(value: number) => string-value => ${Math.round(value * 100) / 100}Function to format bubble text

Callbacks

PropTypeRequiredDefaultDescription
onSlidingStart() => void--Called when sliding starts
onValueChange(value: number) => void--Called when the slider value changes
onSlidingComplete(value: number) => void--Called when sliding completes
onTap() => void--Called when the slider is tapped
onHapticFeedback() => void--Called to trigger haptic feedback

Appearance

PropTypeRequiredDefaultDescription
themeSliderTheme-See belowTheme configuration for the slider
styleViewStyle--Style for the container view
containerStyleViewStyle-See belowStyle for the slider track container
bubbleContainerStyleViewStyle--Style for the bubble container
bubbleTextStyleTextStyle--Style for the bubble text
marksStyleViewStyle-See belowStyle for step marks
sliderHeightnumber-5Height of the slider track
thumbWidthnumber-15Width of the thumb
thumbTouchSizenumber-thumbWidthTouch area size around thumb
markWidthnumber-4Width of step marks
bubbleMaxWidthnumber-100Maximum width of bubble
bubbleWidthnumber-0Fixed bubble width
bubbleTranslateYnumber--25Vertical offset of bubble
bubbleOffsetXnumber-0Horizontal offset of bubble

Custom Rendering

PropTypeRequiredDefaultDescription
renderBubble() => React.ReactNode--Custom bubble component
renderThumb() => React.ReactNode--Custom thumb component
renderMark({ index: number }) => React.ReactNode--Custom mark component
renderTrack({ index: number }) => React.ReactNode--Custom track component

Behavior

PropTypeRequiredDefaultDescription
disableboolean-falseDisables all interactions
disableTapEventboolean-trueDisables tap-to-seek behavior
stepnumber--Step value for discrete slider
stepsnumber--Number of steps
snapToStepboolean-trueWhether to snap to steps
heartbeatboolean-falseEnables heartbeat animation
disableTrackFollowboolean-falseDisable thumb following track
disableTrackPressboolean-falseOnly allow dragging thumb
stepTimingOptionsWithTimingConfig | false-falseAnimation config for steps
snapThresholdnumber-0Threshold for snapping to steps
snapThresholdMode'percentage' | 'absolute'-'absolute'Mode for snap threshold
forceSnapToStepboolean-falseAlways snap to nearest step
hapticMode'none' | 'step' | 'both'-'none'When to trigger haptics
isRTLboolean-I18nManager.isRTLEnable RTL (right-to-left) mode

Gesture Configuration

PropTypeRequiredDefaultDescription
activeOffsetXnumber | number[]--Active offset for horizontal gesture
activeOffsetYnumber | number[]--Active offset for vertical gesture
failOffsetXnumber | number[]--Fail offset for horizontal gesture
failOffsetYnumber | number[]--Fail offset for vertical gesture
panHitSlopobject-See belowHit slop for pan gesture

State Management

PropTypeRequiredDefaultDescription
isScrubbingAnimated.SharedValue<boolean>--Track scrubbing state
thumbScaleValueAnimated.SharedValue<number>--Control thumb scale animation
panDirectionValueAnimated.SharedValue<PanDirectionEnum>--Track pan direction

Pan Direction Enum

enum PanDirectionEnum {
  START = 0, // Pan gesture started
  LEFT = 1, // Panning left
  RIGHT = 2, // Panning right
  END = 3, // Pan gesture ended
}

Default Values

Default Theme

{
  minimumTrackTintColor: '#1890ff',
  maximumTrackTintColor: '#e5e5e5',
  cacheTrackTintColor: '#cacaca',
  disableMinTrackTintColor: '#999999',
  bubbleBackgroundColor: '#ffffff',
  heartbeatColor: '#1890ff'
}

Default Container Style

{
  width: '100%',
  height: 5,
  borderRadius: 2,
  borderColor: 'transparent',
  overflow: 'hidden',
  borderWidth: 1,
  backgroundColor: maximumTrackTintColor
}

Default Pan Hit Slop

{
  top: 8,
  left: 0,
  bottom: 8,
  right: 0
}

Default Marks Style

{
  width: 4,
  height: 4,
  backgroundColor: '#fff',
  position: 'absolute',
  top: 2
}

Theme Configuration

The slider can be themed using the theme prop:

interface SliderTheme {
  minimumTrackTintColor: string; // Progress track color
  maximumTrackTintColor: string; // Background track color
  cacheTrackTintColor: string; // Cache track color
  disableMinTrackTintColor: string; // Disabled track color
  bubbleBackgroundColor: string; // Bubble background color
  heartbeatColor: string; // Heartbeat animation color
}