1.1.2 • Published 7 years ago

react-native-div v1.1.2

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

react-native-div

This is a wrapper of the View element that speeds up the process of creating graphic layouts for your React Native app; it's easy to configure and it allows you to implement animations either predefined either custom.

Installation

$ npm i --save react-native-div

import { Div } from 'react-native-div' ;

...

render(){
  return <Div w="200" h="200" bgColor="green"></Div>
}

Props

proptypeofvaluedescription
wstring,number"200",200shortcut to define the Width , if the perc prop is true the value becomes a percentage based on the parent
hstring,number"100",100shortcut to define the Height , if the perc prop is true the value becomes a percentage based on the parent
percbooleantrue,falsedefines the Width and the Height as percentage of the parent element
alignstringleft,center,rightalignment in horizontal mode
vAlignstringtop,center,bottomalignment in vertical mode
bgColorstringred,#ffcc00,..background color with the same values of the normal styling
columnbooleantrue,falsealign the content vertically
_onPressfunctionfunc...call a function on touch event
animatestringbounceIn,bounceOutIn,..animate the element with a predefined animation
animateCustomarray{x,y,r,s,o,t,f},{..animate the element with a custom animation
delaynumber0,.5,1.2,..seconds of delay for this animation

Predefined Animations

bounceIn bounceOutIn bounceLeft bounceRight bounceUp bounceDown ..

Custom Animations

render(){
  var elasticUp = [ { y : 100 , f : 1 } ] ;
  return <Div w="100" h="100" bgColor="red" animateCustom={ elasticUp } ></Div>
}
render(){
  var leftRightCenter = [ { x : -100 , t : 1 } , { x : 100 , t : 2 } , { x : 0 , t : 1 } ] ;
  return <Div w="100" h="100" bgColor="red" animateCustom={ leftRightCenter } ></Div>
}
1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago