API 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)

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

Custom Rendering

PropTypeRequiredDefaultDescription
renderBubble() => React.ReactNode--Custom bubble component
renderThumb() => React.ReactNode--Custom thumb component
renderMark({ index: number }) => React.ReactNode--Custom mark 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

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

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
}