4.0.0 • Published 5 months ago

rn-vertical-slider v4.0.0

Weekly downloads
195
License
MIT
Repository
github
Last release
5 months ago

:control_knobs: rn-vertical-slider

A highly customizable vertical slider component for React Native using React Native Gesture Handler and Reanimated. Support this project with a ★ on Github.

:inbox_tray: Installation

You can install this package using either Yarn or NPM.

npm install rn-vertical-slider

yarn add rn-vertical-slider

rn-vertical-slider requires react-native-reanimated to be installed, which is a peer dependency. This is a breaking change from version 2 to version 3.

:bulb: Usage

import VerticalSlider from 'rn-vertical-slider';

function App() {
  const [value, setValue] = useState(0);
  return (
    <VerticalSlider
      value={value}
      onChange={(value) => setValue(value)}
      height={200}
      width={40}
      step={1}
      min={0}
      max={100}
      borderRadius={5}
      minimumTrackTintColor="#2979FF"
      maximumTrackTintColor="#D1D1D6"
      showBallIndicator
      ballIndicatorColor="#2979FF"
      ballIndicatorTextColor="#fff"
      ballIndicatorWidth={80}
      ballIndicatorHeight={40}
    />
  );
}

:book: 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.
showBackgroundShadowboolean0Display shadow on Indicator (If available) and Slider
shadowPropsobjectsee belowShadow Configuration for Slider
renderIndicatorboolean0Render a custom slider indicator

:art: Demo

You can try the example app by cloning this repo and running the following commands:

cd example
yarn install
npx expo start

:handshake: Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you find a bug or have a feature request. See the contributing guide to learn how to contribute to the repository and the development workflow.

:scroll: License

This project is licensed under the MIT License.

4.0.0

5 months ago

3.1.1

11 months ago

3.1.0

1 year ago

2.0.2

4 years ago

2.0.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago