0.2.2 • Published 2 months ago

react-native-ruler-picker v0.2.2

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

react-native-ruler-picker

npm HitCount

⚡ Lightning-fast and customizable Ruler Picker component for React Native

Preview

Installation

  1. Ensure sure you've installed flash-list
  2. yarn add react-native-ruler-picker or npm install react-native-ruler-picker

Usage

import { RulerPicker } from 'react-native-ruler-picker';

<RulerPicker
  min={0}
  max={240}
  step={1}
  fractionDigits={0}
  initialValue={0}
  onValueChange={(number) => console.log(number)}
  onValueChangeEnd={(number) => console.log(number)}
  unit="cm"
/>;

Props

NameTypeRequiredDefault ValueDescription
widthnumberNowindowWidthWidth of the ruler picker
heightnumberNo500Height of the ruler picker
minnumberYes-Minimum value of the ruler picker
maxnumberYes-Maximum value of the ruler picker
stepnumberNo1Step of the ruler picker
initialValuenumberNominInitial value of the ruler picker
fractionDigitsnumberNo1Number of digits after the decimal point
unitstringNo'cm'Unit of the ruler picker
indicatorHeightnumberNo80Height of the indicator
indicatorColorstringNo'black'Color of the center line
valueTextStyleRulerPickerTextPropsNo-Text style of the value
unitTextStyleRulerPickerTextPropsNo-Text style of the unit
decelerationRate'fast' | 'normal' | numberNo'normal'Deceleration rate of the ruler picker
onValueChange(value: string) => voidNo-Callback when the value changes
onValueChangeEnd(value: string) => voidNo-Callback when the value changes end
gapBetweenStepsnumberNo10Gap between steps
shortStepHeightnumberNo20Height of the short step
longStepHeightnumberNo40Height of the long step
stepWidthnumberNo2Width of the steps
shortStepColorstringNo'lightgray'Color of the short steps
longStepColorstringNo'darkgray'Color of the long steps

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library