1.0.2 • Published 3 years ago

@m15r/react-native-range-slider v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React Native Range Slider

Range Slider for React Native using react-native-gesture-handler.

Installation

Using Yarn:

yarn add @m15r/react-native-range-slider

Using NPM:

npm install @m15r/react-native-range-slider

If you wish to use vibration when sliding the handles, follow the installation instructions for react-native-haptic-feedback and enable the vibrate prop on your RangeSlider.

Example

import RangeSlider from '@m15r/react-native-range-slider'

export default function RangeSliderExample() {

  const handleChange = (values) => {
    // Your logic
  }

  return (
    <RangeSlider
      range={[0,100]}
      defaultValues={[25,75]}
      onChange={handleChange} />
  )
  
}

Props

PropDescriptionDefaultRequired
rangeArray containing min. and max. values[0,100]:white_check_mark:
defaultValuesInitial values for the range slider[25,75]:white_check_mark:
onChangeReturns an array with min. and max. values
barHeightHeight of the slider bar30
barStyleApply custom styling to the bar{}
fillStyleApply custom styling to the fill between handles{}
handleSizeSize of the handles30
handleStyleApply custom styling to the handles{}
vibrateVibrate when moving the handle using react-native-haptic-feedbackfalse