1.0.1 • Published 5 years ago

react-native-column-slider v1.0.1

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

react-native-column-slider

A pure JavaScript Slider component, UI similar to iPhone brightness regulator.

Usage

$ npm i react-native-column-slider
import React from 'react';
import { StyleSheet, View } from 'react-native';
import ColumnSlider from 'react-native-column-slider';

export default class App extends React.PureComponent {
  render() {
    return (
        <View style={styles.container}>
          <ColumnSlider
              height={300}
              width={100}
              min={0}
              max={50}
              step={1}
              minimumTrackTintColor='#ffc069'
              maximumTrackTintColor='#fff'
              textStyle={{ color: '#ffc069' }}
              suffix="℃"
          />
        </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

Props

PropertyTypeDefaultDescription
valuenumber0Initial value of the slider.
disabledboolfalseIf true the user won't be able to move the slider.
minnumber0Initial minimum value of the slider.
maxnumber0Initial maximum value of the slider.
stepnumber0Step value of the slider. The value should be between 0 and maximumValue - minimumValue).
minimumTrackTintColorstring'#fff'The bottom color.
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).
stylestylenullThe style applied to the slider container.
textStyleobjectnullThe style applied to the value text.
iconnodenullThe bottom icon.
widthnumber100The with of component.
suffixstringnullThe suffix of the value.
borderRadiusnumber0The border radius of component.