1.0.3 β€’ Published 4 years ago

react-native-vertical-slider-component v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

πŸ†• React Native Vertical Slider Component 🎚

(react-native-vertical-slider-component)

A vertical Slider for React Native written entirely in javascript. Support this project with a β˜… on Github.

✨Features

  • πŸ“ Completely written in Typescript
  • πŸ”— No Native linking required

Example1 Example2

🏁 Getting Started

  • To add this slider to your project :
npm install react-native-vertical-slider-component

🎨 Usage

  • A basic example of slider
<VerticalSlider
          value={1}
          disabled={false}
          min={0}
          max={100}
          onChange={(value: number) => {
            console.log("CHANGE", value);
          }}
          onComplete={(value: number) => {
            console.log("COMPLETE", value);
          }}
          width={50}
          height={300}
          step={1}
          borderRadius={5}
          minimumTrackTintColor={"gray"}
          maximumTrackTintColor={"tomato"}
          showBallIndicator
          ballIndicatorColor={"gray"}
          ballIndicatorTextColor={"white"}
        />

πŸŽ› Props

PropertyTypeDefaultDescription
valuenumber0Value of the slider.
disabledboolfalseEnable or disable slider.
minnumber0Minimum value for slider.
maxnumber0Maximum value for slider.
onChangefunctionnullCallback continuously called while the user is dragging the slider.
onCompletefunctionnullCallback called when the user finishes changing the value (e.g. when the slider is released).
widthnumber0Width of the slider.
heightnumber0Height of the slider.
borderRadiusnumber0The border radius of component.
maximumTrackTintColorstring'#eee'The top color.
minimumTrackTintColorstring'#fff'The bottom color.
showBallIndicatorboolfalseTo show or hide indicator.
stepnumber0This value describes number of steps to skip.
ballIndicatorColorstring'#fff'Background color for Indicator
ballIndicatorWidthnumber48Diameter of Indicator. Height of Indicator : If renderIndicator present
ballIndicatorHeightnumber48Diameter of Indicator. Width of Indicator : If renderIndicator present
ballIndicatorPositionnumber-50Horizontal position of Indicator with respect to current selected value.
ballIndicatorTextColorstring'#fff'Indicator text color.
animationDurationnumber0Animation Duration
showBackgroundShadowboolean0Display shadow on Indicator (If available) and Slider
shadowPropsobjectsee belowShadow Configuration for Slider
renderIndicatorboolean0Render a custom slider indicator
  • shadowProps

shadowProps define the shadow properties for slider (Indicator Component if shown) Default Props :

  {
      shadowOffsetWidth = 0,
      shadowOffsetHeight = 1,
      shadowOpacity = 0.22,
      shadowRadius = 2.22,
      elevation = 3,
      shadowColor = '#000',
 }
  • renderIndicator

renderIndicator is used when you want to use custom indicator for the slider. ballIndicatorHeight, ballIndicatorWidth will define the height and width of the component.

  • Custom renderIndicator

    Custom Indicator

πŸ“Œ Extras

  • Gradient Slider Slider with linear gradient
  • Github β˜…'s are more additcting than Coffee 🀩

β˜€οΈ License

This project is licensed under the MIT License - see the LICENSE.md file for details

🚧 Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT