1.0.3 • Published 5 years ago

rn-vertical-slider-gradient v1.0.3

Weekly downloads
10
License
MIT
Repository
github
Last release
5 years ago

rn-vertical-slider-gradient

A vertical Slider for React Native written entirely in javascript that support linear gradient

Getting Started

Example1 Example2

  • To add this slider to your project :
$ npm install rn-vertical-slider-gradient

Dependencies

Usage

  • A basic example of slider
<VerticalSlider
          value={180}
          disabled={false}
          min={0}
          max={200}
          onChange={(value: number) => {
            // console.log("CHANGE", value);
          }}
          onComplete={(value: number) => {
            // console.log("COMPLETE", value);
          }}
          width={50}
          height={300}
          step={1}
          borderRadius={5}
          minimumTrackTintColor={[
            "#2ecc71",
            "#27ae60",
            "#f1c40f",
            "#f39c12",
            "#d35400",
            "#c0392b"
          ]}
          maximumTrackTintColor="#ecf0f1"
          showBallIndicator
          ballIndicatorTextColor={"white"}
        />

Props

PropertyTypeDefaultDescription
valuenumber0Value of the slider.
disabledboolfalseEnable or disable slider.
minnumber0Minimum value for slider.
maxnumber0Maximum value for slider.
stepnumber0This value describes number of stepsto skip.
minimumTrackTintColorArray'#00000'Array of colors must be supplied to minimumTrackTintColor.
maximumTrackTintColorstring'#eee'The top color.
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).
borderRadiusnumber0The border radius of component.
widthnumber0Width of the slider.
heightnumber0Height of the slider.
showBallIndicatorboolfalseTo show or hide indicator.
ballIndicatorColorstringnullBackground color for Indicator. If none supplied then colors from minimumTrackTintColor are taken.
ballIndicatorWidthnumber48Diameter of Indicator.
ballIndicatorPositionnumber-50Horizontal position of Indicator with respect to current selected value.
ballIndicatorTextColorstring'#fff'Indicator text color.

License

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