1.4.3 • Published 2 years ago

react-native-range-slider-expo v1.4.3

Weekly downloads
163
License
MIT
Repository
-
Last release
2 years ago

react-native-range-slider-expo

Supports Android and iOS    MIT License

Customizable range slider for react native apps

Getting started

npm i react-native-range-slider-expo

Usage

Examples - display

Examples - code (reflects the short video above)

import RangeSlider, { Slider } from 'react-native-range-slider-expo';
     const [fromValue, setFromValue] = useState(0);
     const [toValue, setToValue] = useState(0);
     const [value, setValue] = useState(0);
     return (
          <View style={styles.container}>
               <View>
                    <RangeSlider min={5} max={25}
                         fromValueOnChange={value => setFromValue(value)}
                         toValueOnChange={value => setToValue(value)}
                         initialFromValue={11}
                    />
                    <Text>from value:  {fromValue}</Text>
                    <Text>to value:  {toValue}</Text>
               </View>
               <View>
                    <Slider min={0} max={40} step={4}
                         valueOnChange={value => setValue(value)}
                         initialValue={12}
                         knobColor='red'
                         valueLabelsBackgroundColor='black'
                         inRangeBarColor='purple'
                         outOfRangeBarColor='orange'
                    />
                    <Text>value:  {value}</Text>
               </View>
          </View>
     );

API - RangeSlider (default import)

PropertyTypeRequiredDefault
minnumberyes-
maxnumberyes-
fromValueOnChangecallbackyes-
toValueOnChangecallbackyes-
stepnumberno1
styleSizestring ( 'small' | 'medium' | 'large' | number )no'medium'
fromKnobColorstring (color)no'#00a2ff'
toKnobColorstring (color)no'#00a2ff'
inRangeBarColorstring (color)no'rgb(100,100,100)'
outOfRangeBarColorstring (color)no'rgb(200,200,200)'
valueLabelsBackgroundColorstring (color)no'#3a4766'
rangeLabelsTextColorstring (color)no'rgb(60,60,60)'
showRangeLabelsbooleannotrue
showValueLabelsbooleannotrue
initialFromValuenumbernoas 'min' value
initialToValuenumbernoas 'max' value
knobSizenumberno24/34/44
containerStylestyleno-
barHeightnumberno8/11/15
labelFormatter(value: number) => stringno-

API - Slider (1 knob)

PropertyTypeRequiredDefault
minnumberyes-
maxnumberyes-
valueOnChangecallbackyes-
stepnumberno1
styleSizestring ( 'small' | 'medium' | 'large' | number )no'medium'
knobColorstring (color)no'#00a2ff'
inRangeBarColorstring (color)no'rgb(200,200,200)'
outOfRangeBarColorstring (color)no'rgb(100,100,100)'
valueLabelsTextColorstring (color)no'white'
valueLabelsBackgroundColorstring (color)no'#3a4766'
rangeLabelsTextColorstring (color)no'rgb(60,60,60)'
showRangeLabelsbooleannotrue
showValueLabelsbooleannotrue
initialValuenumbernoas 'min' value
containerStylestyleno-
barHeightnumberno8/11/15
labelFormatter(value: number) => stringno-

API - Textual Slider

PropertyTypeRequiredDefault
valuesItemTypeyes-
valueOnChangecallbackyes-
styleSizestring ( 'small' | 'medium' | 'large' | number )no'medium'
knobColorstring (color)no'#00a2ff'
inRangeBarColorstring (color)no'rgb(200,200,200)'
outOfRangeBarColorstring (color)no'rgb(100,100,100)'
valueLabelsTextColorstring (color)no'white'
valueLabelsBackgroundColorstring (color)no'#3a4766'
rangeLabelsTextColorstring (color)no'rgb(60,60,60)'
showRangeLabelsbooleannotrue
showValueLabelsbooleannotrue
initialValuenumberno-

License

This project is licensed under the MIT License

Todo

  • Add plain slider (with 1 knob)
  • Add initial values
  • Add numeric style size
  • Add textual values
  • Add prefix/suffix to numeric values
  • Beautify styling
1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

3 years ago

1.3.7

3 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.2.1

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago