1.1.1 • Published 6 years ago

react-native-animated-ruler v1.1.1

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

react-native-animated-ruler

PRs Welcome   code style: prettier   npm version   DUB


Preview

react-native-animated-ruler

Install

Package ManagerCommand
yarnyarn add react-native-animated-ruler
npmnpm i --save react-native-animated-ruler

Usage

import Ruler from 'react-native-animated-ruler';

<Ruler
  style={{ borderRadius: 10, elevation: 3 }}
  width={350}
  height={170}
  vertical={false}
  onChangeValue={value => alert(value)}
  minimum={10}
  maximum={80}
  segmentWidth={2}
  segmentSpacing={20}
  indicatorColor='#FF0000'
  indicatorWidth={100}
  indicatorHeight={80}
  indicatorBottom={20}
  step={10}
  stepColor='#333333'
  stepHeight={40}
  normalColor='#999999'
  normalHeight={20}
  backgroundColor='#FFFFFF'
  numberFontFamily='System'
  numberSize={40}
  numberColor='#000000'
  unit='cm'
  unitBottom={20}
  unitFontFamily='System'
  unitColor='#888888'
  unitSize={16}
/>;

Properties

PropDefaultType
style{}ViewStyle
verticalfalseboolean
widthscreen's widthnumber
heightscreen's height * 0.23number
onChangeValue() => {}function
minimum0number
maximum100number
segmentWidth2number
segmentSpacing20number
indicatorColor'#FF0000'string
indicatorWidth100number
indicatorHeight80number
indicatorBottom20number
step10number
stepColor'#333333'string
stepHeight40number
normalColor'#999999'string
normalHeight20number
backgroundColor'#FFFFFF'string
numberFontFamily'System'string
numberSize40number
numberColor'#000000'string
unit'cm'string
unitBottomscreen's height * 0.027number
unitFontFamily'System'string
unitColor'#888888'string
unitSize16number

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