1.0.2 • Published 2 years ago

sliding-and-editing v1.0.2

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

Installation & Usage

To install this module cd to your project directory and enter the following command:

yarn add @groww-tech/editable-number-slider

or

npm install @groww-tech/editable-number-slider --save

If using iOS please remember to install cocoapods by running: npx pod-install

The following code presents the basic usage scenario of this library:

import EditableNumberSlider from '@groww-tech/editable-number-slider';

<EditableNumberSlider
  minimumValue={0}
  maximumValue={100}
/>

You can pass several props to customize the component:

import EditableNumberSlider from '@groww-tech/editable-number-slider';

<EditableNumberSlider
  minimumValue={0}
  maximumValue={100}
  initialValue={40}
  sliderProps={
    disabled: false,
    thumbTintColor: 'red',
    minimumTrackTintColor: 'black',
    maximumTrackTintColor: 'gray',
  }
  prefix={'$ '}
  sliderStep={10}
  labelColor={'#ff00ff'}
  labelErrorColor={'#ff0000'}
  nativeRipple={false}
/>

Properties

PropertyDescriptionTypeRequiredPlatform
maximumValueInitial maximum value of the slider.Default value is 1.numberYes
minimumValueInitial minimum value of the slider.Default value is 0.numberYes
sliderStepStep value of the slider. The value should be between 0 and (maximumValue - minimumValue). Default value is 1numberNo
onValueChangeCallback continuously called while the user is dragging the slider.functionNo
disabledIf true the user won't be able to move the slider.Default value is false.boolNo
containerStyleCustom style for container.styleNo
editableboolean for making text input editable. Default: TruebooleanNo
rightElementCustom component for the edit/done buttoncomponentNo
onEditStartCallback called when editing startsFunctionNo
onEditCallback called when editing is doneFunctionNo
absoluteMinimaNeeded to protect slider going to a number below minimum in case of a flicknumberNo
formatValueShow custom string instead of just numerical value of slider. Accepts value as parameterFunctionNo
labelColorCustom color for labelcolor(in hex)No
lableErrorColorCustom color for when label value is incorrectcolor(in hex)No
nativeRippleChoose whether ripple for editable component should be nativeRipple. Default: truebooleanNo
sliderPropsCustom Slider Props customThumb?: string, minimumTrackTintColor?: string; maximumTrackTintColor?: string; thumbTintColor?: string; disabled?: boolean; onSlidingStart?: Function onSlidingComplete?: Function; objectNo

Made with ❤️ at Groww