1.0.2 • Published 5 years ago

react-native-flonger-slider v1.0.2

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

React Native Flonger Slider

A JavaScript slider component for React Native (iOS and Android).
React Native Flonger Slider is a high-quality slider with a stunning UI / UX.

demo

Installation

npm install react-native-flonger-slider --save

Usage

import MotionSlider from 'react-native-flonger-slider';
<View>
    <MotionSlider
    	title={'Choose the desired temperature'} 
        min={-20} 
        max={40}
        step={10}
        value={25.8} 
        decimalPlaces={1}
        units={'º'}
        backgroundColor={['rgb(3, 169, 244)', 'rgb(255, 152, 0)', 'rgb(255, 87, 34)']}
        onValueChanged={(value) => console.log(value)}
        onPressIn={() => console.log('Pressed in')}
        onPressOut={() => console.log('Pressed out')}
        onDrag={() => console.log('Dragging')}
    />
</View>

API

Properties

PropertyDescriptionType
widthSlider width.number
heightSlider height.number
borderRadiusSlider border radius.number
backgroundColorString array containing the slider colors. By default it has only one element.string
decimalPlacesDecimal places to display on min, max and value elements.number
titleSlider title.string
titleColorSlider title color.string
titleStyleSlider title custom style.StyleSheet
minMinimum value of the slider.number
maxMaximum value of the slider.number
valueCurrent slider value.number
unitsValue units (e.g. 'km').string
minColorColor of min text element.string
maxColorColor of max text element.string
valueColorColor of value text element.string
valueBackgroundColorColor of value container's background color. By default this color inherits the slider's background color.string
fontSizeFont size for min, max and value text elements.number
fontWeightFont weight for min, max and value text elements.string
fontFamilyFont family for min, max and value text elements.string

Function Properties

PropertyInputNotes
onValueChangedSlider valueUse this to update catch slider value on parent component
onPressIn
onPressOut
onDrag

Acknowledgement

License

MIT.