1.2.1 • Published 5 years ago

react-native-list-slider v1.2.1

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

react-native-list-slider

List slider for React Native - Pure JS Slider base on FlatList. Android and iOS platform supported. Tested on RN version 0.55.x.

2018-05-15 23-13-00

Props

PropertyTypeDefaultDescription
valueNumberrequiredDefault value which will be used.
onValueChangeFunctionrequiredCallback called on every value changed. value: Number as parameter.
multiplicityNumber0.1
decimalPlacesNumber1
arrayLengthNumber10000
renderThumbFunctionoptionalFunction to render thumb - middle component which is fixed
thumbStyleObjectoptionalYou can pass your style to overwrite default one
mainContainerStyleObjectoptionalYou can pass your style to overwrite default container style
itemStyleObjectoptionalYou can pass your style to overwrite default item style
tenthItemStyleObjectoptionalYou can pass your style to overwrite active item style
scrollEnabledbooleantrueIs enabled to scroll or not
initialPositionValuenumberundefinedvalue of 1st element
maximumValuenumberundefinedmax value to achieve

How to use it

import React, { Component } from 'react';
import ReactNative from 'react-native';
import RNListSlider from 'react-native-list-slider';

const {
  View,
  Text,
  StyleSheet,
} = ReactNative;

export default class App extends Component {
  state = {
    value: 0,
  };

  onValueChanged = value => this.setState({ value });

  render() {
    return (
      <View style={styles.container}>
        <View>
          <Text>Value: {this.state.value}</Text>
        </View>
        <RNListSlider
          value={this.state.value}
          onValueChange={this.onValueChanged}
        />
      </View>
    );
  }
}

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

Example

$ cd example
$ yarn
$ react-native run-ios

License

MIT

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.3

6 years ago