react-native-animated-ruler
Preview
Install
Package Manager | Command |
---|---|
yarn | yarn add react-native-animated-ruler |
npm | npm i --save react-native-animated-ruler |
Usage
import Ruler from 'react-native-animated-ruler'; <Ruler = = = = = = = = = ='#FF0000' = = = = ='#333333' = ='#999999' = ='#FFFFFF' ='System' = ='#000000' ='cm' = ='System' ='#888888' =/>;
Properties
Prop | Default | Type |
---|---|---|
style | {} | ViewStyle |
vertical | false | boolean |
width | screen's width | number |
height | screen's height * 0.23 | number |
onChangeValue | () => {} | function |
minimum | 0 | number |
maximum | 100 | number |
segmentWidth | 2 | number |
segmentSpacing | 20 | number |
indicatorColor | '#FF0000' | string |
indicatorWidth | 100 | number |
indicatorHeight | 80 | number |
indicatorBottom | 20 | number |
step | 10 | number |
stepColor | '#333333' | string |
stepHeight | 40 | number |
normalColor | '#999999' | string |
normalHeight | 20 | number |
backgroundColor | '#FFFFFF' | string |
numberFontFamily | 'System' | string |
numberSize | 40 | number |
numberColor | '#000000' | string |
unit | 'cm' | string |
unitBottom | screen's height * 0.027 | number |
unitFontFamily | 'System' | string |
unitColor | '#888888' | string |
unitSize | 16 | number |
Example
Take a look at example:
git clone https://github.com/MohamadKh75/react-native-animated-ruler.git cd example yarn react-native run-android # OR react-native run-ios
Credit
This library is based on awesome Youtube video by Catalin Miron
License
MIT