1.0.2 • Published 2 years ago

rn-awesome-slider v1.0.2

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

React Native Awesome Sliders

Installation

yarn add rn-awesome-slider

# or

npm install rn-awesome-slider

Height Slider

A Height slider is a design component that enables the selection of height between custom ranges. As a rule of thumb, the component height equals the screen height multiplied by 0.6

preview

Properties

PropertyDescriptionType
genderGender of the lottie to display Default male.GenderNo
measureData.rangeThe measure range. Default from: 40, to: 240.RangeNo
measureData.stepThe measure step. Default 10numberNo
measureData.sectionSizeThe number of lines in each section. Default 6numberNo
measureData.initialValueInitial maximum value of the slider. Half of the range.to.numberNo
labelData.hintThe hint text below the label.Default value is Kg.stringNo
labelData.colorThe color of the label text Default value is #8503e3.colorNo
labelData.fractionDigitsThe digits fraction to display on the text label Default value is 0.numberNo
labelData.placeholderThe text to display on the text label when slider on minimum value. Default value is range.from.numberNo
cursorData.colorThe color of the cursorDefault value is #8503e3.colorNo
dividerData.colorThe color of the dividerDefault value is #bababa.colorNo
onSlidingStartCallback that is called when the user picks up the slider.The initial value is passed as an argument to the callback handler.functionNo
onSlidingEndCallback that is called when the user releases the slider, regardless if the value has changed.The current value is passed as an argument to the callback handler.functionNo
onValueChangeCallback continuously called while the user is dragging the slider.functionNo

Usage

import React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { WeightSlider } from 'rn-awesome-slider';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: 44,
    paddingBottom: Platform.OS === 'ios' ? 44 : 12,
    backgroundColor: '#ffffff',
  },
});

export default function App() {
  return (
    <View style={styles.container}>
      <WeightSlider
        measureData={{ range: { from: 40, to: 240 }, step: 20, sectionSize: 6, initialValue: 120 }}
        labelData={{ color: '#EE6000FF' }}
        cursorData={{ color: '#EE6000FF' }}
      />
    </View>
  );
}

Weight Slider

A weight slider is a design component that enables the selection of weight between custom ranges.

preview

Properties

PropertyDescriptionType
genderGender of the lottie to display Default male.GenderNo
measureData.rangeThe measure range. Default from: 0, to: 160.RangeNo
measureData.stepThe measure step. Default 10numberNo
measureData.sectionSizeThe number of lines in each section. Default 10numberNo
measureData.initialValueInitial maximum value of the slider. Half of the range.to.numberNo
labelData.hintThe hint text below the label.Default value is Cm.stringNo
labelData.colorThe color of the label text Default value is #8503e3.colorNo
labelData.fractionDigitsThe digits fraction to display on the text label Default value is 0.numberNo
labelData.placeholderThe text to display on the text label when slider on minimum value. Default value is range.from.numberNo
cursorData.colorThe color of the cursorDefault value is #8503e3.colorNo
onSlidingStartCallback that is called when the user picks up the slider.The initial value is passed as an argument to the callback handler.functionNo
onSlidingEndCallback that is called when the user releases the slider, regardless if the value has changed.The current value is passed as an argument to the callback handler.functionNo
onValueChangeCallback continuously called while the user is dragging the slider.functionNo

Usage

import React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { HeightSlider } from 'rn-awesome-slider';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: 44,
    paddingBottom: Platform.OS === 'ios' ? 44 : 12,
    backgroundColor: '#ffffff',
  },
});

export default function App() {
  return (
    <View style={styles.container}>
      <HeightSlider
        gender={'female'}
        measureData={{ range: { from: 0, to: 160 }, step: 10, sectionSize: 10, initialValue: 65 }}
        labelData={{ placeholder: '00' }}
        dividerData={{ color: 'blue' }}
        cursorData={{ color: 'blue' }}
      />
    </View>
  );
}

License

MIT