1.0.5 • Published 4 years ago

react-native-companim v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Indicators (1) 20200531-165058-edited1 20200531-170259-edited

Installation

npm i react-native-companim

Components Animated

  • MultiplyButton
  • FadeButton
  • RotateButton
  • BounceButton
  • ScaleButton
  • Card
  • CircleIndicator
  • MultiplyIndicator
  • RotateIndicator
  • ScaleIndicator
  • SequentIndicator
  • SuddenIndicator

Usage

MultiplyButton

import React from 'react'
import {MultiplyButton} from 'react-native-companim'
import {View} from "react-native"

export default class App extends React.Component{

  render() {
    return (
      <View style={{justifyContent:"center",alignItems:"center",flex:1}}>


        <MultiplyButton middleButtonPixel={50} 
                        lastButtonPixel={100} 
                        direction="y" 
                        tension={40} 
                        friction={40} 
                        delay={500}
                        />
    )}
  }

Code explanation: You can specify style of the all of three button whatever you want.You can also specify child components of the buttons You can also specify:

  • direction value which is movement direction for all buttons
  • tension value
  • friction value
  • delay value which is waiting time before animation
  • middleButtonPixel value which is pixel that you want to move for middle button
  • lastButtonPixel value which is pixel that you want to move for last button
  • firstButtonChilds value which is components that you want set inside of the button
  • secondButtonChilds value which is components that you want set inside of the button
  • lastButtonChilds value which is components that you want set inside of the button
  • firstButtonStyle value which is style of the button
  • middleButtonStyle value which is style of the button
  • lastButtonStyle value which is style of the button

prop#default
directionx-axis
tension40
friction40
delay0
middleButtonPixe50
lastButtonPixel100
firstButtonChildsnone
secondButtonChildsnone
lastButtonChildsnone
firstButtonStyleobject
middleButtonStyleobject
lastButtonStyleobject

Card

import React from 'react'
import {Card} from 'react-native-companim'
import {View} from "react-native"

const data = [1,2,3,4,5,6]//it is added just for map function.Not important!

const datas={   "name":"xxxx",
                "title":"xxxx",
                "subtitle":"xxxx",
                "middleTitle":"xxxx"
          }

export default class App extends React.Component{

  render() {
    return (
        {data.map((_,index)=>{ return <Card sequentially={index} 
                                            animationType="opacity" 
                                            title={datas.title} 
                                            titleStyle={{color:"green"}}
                                            />
                                            })}
      )
    }
}

Code explanation: You can specify style of the title,subtitle,middletitle and endtitle whatever you want.You can also specify:

  • animationType value which is can take leftToRight , opacity , bothLeftToRightOpacity, bytheZaxis, bytheXaxis and bytheYaxis values(for the animation, index value of the map function is necessary)
  • sequentially value which takes index of the map function (necessary for the animation)
prop#default
animationTypeleftToRight
sequentiallyindex of map function(it necessary for animation)
titlexxxx
titleStyle{color:"green"}
subtitle{color:"blue"}
middleTitlexxxx
middleTitleStyle{color:"green"}
endTitlexxxx
endTitleStyle{color:"green"}
imagenone

Bounce Button

import React from 'react'
import {BounceButton} from 'react-native-companim'
import {View} from "react-native"

export default class App extends React.Component{

 render() {
   return (
       <BounceButton   style={{backgroundColor:"green",width:200,height:200}}
                       duration={500} 
                       direction={false}
                       friction={false} 
                       delay={0}/>
     )
   }
}

Code explanation: You can specify style of the button whatever you want.You can also specify:

  • duration value which is the complement time of the animation
  • direction value which is used for direction of the animation such as to forward(with false value) or to upward(with true value)
  • friction value is the effect of the animation
  • delay value is the waiting time before the animation
prop#default
duration500
direction(true)forwards
friction40
delay0
styleobject

Fade Button

import React from 'react'
import {FadeButton} from 'react-native-companim'
import {View} from "react-native"

export default class App extends React.Component{

 render() {
   return (
         <FadeButton   style={{backgroundColor:"green",width:200,height:200}}
                       duration={500} 
                       repeat={true} 
                       gone={true}/>
     )
   }
}

Code explanation: You can specify style of the button whatever you want.You can also specify :

  • duration value which is the complement time of the animation
  • repeat value which is repetition of the animation.If it is true, animation playing continuously
  • gone value is that when is true , button is not shown again
prop#default
duration1000
gone(false)
repeatfalse
styleobject

Rotate Button

import React from 'react'
import {RotateButton} from 'react-native-companim'
import {View} from "react-native"

export default class App extends React.Component{

 render() {
   return (
         <RotateButton  
                       style={{backgroundColor:"green",width:200,height:200}}
                       from_deg="0" 
                       to_deg="-45"
                       delay={100} 
                       duration={500} 
                       type="infinite" />
     )
   }
}

Code explanation: You can specify style of the button whatever you want.You can also specify :

  • from_deg value which is beginning degree of the animation
  • to_deg value which is last degree of the animation
  • delay value is waiting time before the animation
  • duration value which is the complement time of the animation
  • type value can be take three value which is infinite,comeback,shake
prop#default
typeshake
from_degnone
to_degnone
delay0
duration500
styleobject

Scale Button

import React from 'react'
import {ScaleButton} from 'react-native-companim'
import {View} from "react-native"

export default class App extends React.Component{

 render() {
   return (
         <ScaleButton  
                       style={{backgroundColor:"green",width:200,height:200}}
                       animationType="bothXYaxis"
                       duration={1000} 
                       />
     )
   }
}

Code explanation: You can specify style of the button whatever you want.You can also specify :

  • delay value is waiting time before the animation
  • duration value which is the complement time of the animation
  • animationType value can be take three value which is bothXYaxis,byTheYaxis,byTheXaxis
prop#default
animationTypebyTheXaxis
duration1000
delay0
styleobject

CircleIndicator

import React from 'react'
import {CircleIndicator} from 'react-native-companim'

export default class App extends React.Component{

 render() {
   return (
         <CircleIndicator  
                       color={["gray","blue","yellow","green"]}
                       delay={0}
                       />
     )
   }
}
prop#default
duration2000
delay0
color"gray","blue","yellow","green"

MultiplyIndicator

import React from 'react'
import {MultiplyIndicator} from 'react-native-companim'

export default class App extends React.Component{

  render() {
    return (
          <MultiplyIndicator  
                        duration={1000} 
                        tension={40}
                        />
      )
    }
}
prop#default
duration2000
delay0
tension40
friction40
color"green","blue","yellow"

RotateIndicator

import React from 'react'
import {RotateIndicator} from 'react-native-companim'

export default class App extends React.Component{

  render() {
    return (
          <RotateIndicator  
                        duration={1000} 
                        delay={0}
                        />
      )
    }
}
prop#default
duration1000
delay0

ScaleIndicator

import React from 'react'
import {ScaleIndicator} from 'react-native-companim'

export default class App extends React.Component{

  render() {
    return (
          <ScaleIndicator  
                        tension={80} 
                        />
      )
    }
}
prop#default
tension200
styleobject

Sequent Indicator

import React from 'react'
import {SequentIndicator} from 'react-native-companim'

export default class App extends React.Component{

  render() {
    return (
          <SequentIndicator  
                        tension={200}
                        middleStyle={{......}}
                        />
      )
    }
}
prop#default
tension40
rightSecondaryStyleobject
rightFirstStyleobject
leftFirstStyleobject
leftSecondaryStyleobject
middleStyleobject

Sudden Indicator

import React from 'react'
import {SuddenIndicator} from 'react-native-companim'

export default class App extends React.Component{

  render() {
    return (
          <SuddenIndicator  
                       />
      )
    }
}
prop#default
tension90
styleobject