1.0.8 • Published 1 year ago

react-native-fadeview-wrapper v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

React Native FadeView

FadeView is a handy component written in TypeScript in order to handle the fade animations more easier for every react native component.

npm.io

Installing

For the latest stable version:

using npm:

npm install --save react-native-fadeview-wrapper

using yarn:

yarn add react-native-fadeview-wrapper

Usage

import React, { Component } from 'react';
import FadeView, { Bearing } from 'react-native-fadeview-wrapper';

const Example = () => {

    const [isVisible, setIsVisible] = React.useState<boolean>(false)

    return (
      <FadeView 
          visible={visible} 
          bearingMoveDistance={20}
          leaveBearing={Bearing.Top} 
          entranceBearing={Bearing.Bottom}>
          {/** any components can be used here in order to have the fade animation */}    
      </FadeView>
    );
}

Documentation

here is the properties and the descriptions of it:

Props NameDefaultTypeisRequiredDescription
visibleit's requiredbooleanYESchanging this param would initiate the fade animation
shouldEnterWithAnimationfalsebooleanNOif it's true, then the first state of visible would be presented by animation
styleundefinedViewStyleNOoptinal style for the fadeview itself
bearingMoveDistance50numberNOoption distance when you pass the directional Bearing for entrance or leave
easingEasing.inOut(Easing.linear)EasingFunctionNOChange the Easing function of the animation here
removeChildrenAfterDisapearancefalsebooleanNOyou can choose if you want the children view to be removed after disappearance
childrenundefinedJSX.ElementJSX.Element[]NOchild component(s) in order to have the fade animation
entranceBearingBearing.CenterBearingNOentrance animation with can be determined by Bearing enum from the lib, values: Top, Bottom, Left, Right , Center
leaveBearingBearing.CenterBearingNOleave animation with can be determined by Bearing enum from the lib, values: Top, Bottom, Left, Right , Center
fadeOutScale1.1numberNOscale of fade out state of the animation
duration200numberNOmilliseconds of the fade animation
animationFinishedundefined(visible: boolean) => voidNOcall back closure in order to do something after each animation is finished
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago