Gathering detailed insights and metrics for animation-wrapper-view
Gathering detailed insights and metrics for animation-wrapper-view
Gathering detailed insights and metrics for animation-wrapper-view
Gathering detailed insights and metrics for animation-wrapper-view
fk-animation-wrapper-view
Create declarative animations for React Native
react-lottie-wrapper
lottie animation view for React
react-native-animation-wrapper
Creates a view that can have multiple animations which are activated using props. It optionally returns promises that are fulfilled on animation completion.
framer-animate-on-view
Animate components when they are in intersection view of screen, simple wrapper with default animation based on framer-motion
Declarative animations with imperative controls for RN/RNW.
npm install animation-wrapper-view
Typescript
Module System
Node Version
NPM Version
TypeScript (99.85%)
JavaScript (0.15%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
55 Stars
119 Commits
12 Forks
8 Watchers
3 Branches
13 Contributors
Updated on Sep 09, 2024
Latest Version
1.1.2-TEST.1
Package Id
animation-wrapper-view@1.1.2-TEST.1
Unpacked Size
124.26 kB
Size
26.02 kB
File Count
78
NPM Version
6.13.4
Node Version
12.14.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
AnimationWrapperView is a collection of a well defined set of component level animations, that a developer can utilize just by providing some configurations. AnimationWrapperView will add plug and play type support to the already robust Animated API, and will take care of all the intricate details of each animation type.
https://snack.expo.dev/@swapnil1104/animationwrapperview-playground
npm install animation-wrapper-view
1const bounceConfig: BounceAnimation = { 2 type: AnimationType.BOUNCE, 3 triggerType: AnimationTriggerType.ON_CLICK, 4 bounceHeight: 20, 5 animationDuration: 1000 6}; 7 8<AnimationWrapperView animationConfig={bounceConfig}> 9 {/* {your component} */} 10</AnimationWrapperView>
1private _wrapperRef: AnimationWrapperView | null; 2 3render() { 4 return ( 5 <AnimationWrapperView 6 ref={(ref) => (this._wrapperRef = ref)} 7 animationConfig={this.state.animationConfig} 8 onAnimationFinish={this._onComplete}> 9 {your component} 10 </AnimationWrapperView> 11 ); 12} 13 14// Start animation from the view ref. 15private _onPressToStart = (_: GestureResponderEvent) => { 16 this._wrapperRef?.startAnimation(); 17} 18 19// Pause animation from the view ref. 20private _onPressToPause = (_: GestureResponderEvent) => { 21 this._wrapperRef?.pauseAnimation(); 22} 23 24// Reset animation from the view ref. 25private _onPressToReset = (_: GestureResponderEvent) => { 26 this._wrapperRef?.resetAnimation(); 27}
Prop name | Prop Type | Description |
---|---|---|
animationConfig | BaseAnimation | Object which will contain all optional and non-optional parameters needed to render the animation, including AnimationType, AnimationTriggerType, etc. |
onAnimationFinish | () => void | (optional) Callback function, if provided will be invoked once animation is finished. |
onAnimationStart | () => void | (optional) Callback function, if provided will be invoked when the animation is triggered. |
To note, all the AnimationConfig objects extend from, so animationDuration, triggerType, triggerDelay, and interpolation properties are available to each of the animation definitions.
AnimationConfig | Property name | Type | Description | Demo |
---|---|---|---|---|
BaseAnimationConfig | type | AnimationType | AnimationType enum will determine which type of animation will be rendered | |
triggerType | AnimationTriggerType | AnimationTriggerType enum defines the trigger critera of animation invokation; ON_LOAD, ON_CLICK | ||
interpolation | InterpolationDef | InterpolationDef defines the property related to interpolation that will be applied to the animation timing function. | ||
triggerDelay | number | This controls the animation trigger for ON_LOAD animation, it'll introduce delay before the animation is started | ||
animationDuration | number | This defines how long the animation will be played before stopping. | ||
BounceAnimationConfig | bounceHeight | number | This param defines the value of Y axis translation which will give the visual appearance of the view bouncing. | ![]() |
FadeAnimationConfig | initialOpacity | number | This will define the initial opacity of the view when the Animation starts playing | ![]() |
finalOpacity | number | This will define the final opacity of the view once animation ends | ![]() | |
RippleAnimationConfig | rippleColor | string | This will define the ripple color, the input value could be a supported color name, or a hexcode value. | ![]() |
rippleCount | number | This determines how many ripples will be shown before animation ends | ||
rippleDuration | number | This determines for how long an individual ripple will animate. | ||
rippleIntervalDuration | number | This determines the time duration interval between each ripple. | ||
rippleRadius | number | This will define the size of the ripple in its fully expanded state. | ||
ScaleAnimationConfig | fromScale | number | This will define the initial scale of the view before animation starts. | ![]() |
toScale | number | This will define the final scaale of the view once animation ends. | ![]() | |
SlideHorizontalAnimationConfig | initialOffset | number | This will define the initial offset from the view's original position before starting the animation. | ![]() |
finalOffset | number | This will define the final offset of the view once animation ends, 0 value will lead the view back to its original position. | ![]() | |
direction | SlideHorizontalDirection | The direction param in this case will define the slide direction; 'ltr': left to right, or 'rtl': Right to left | ||
SlideVerticalAnimationConfig | initialOffset | number | This will define the initial offset from the view's original position before starting the animation. | |
finalOffset | number | This will define the final offset of the view once animation ends, 0 value will lead the view back to its original position. | ||
direction | SlideVerticalDirection | The direction param in this case will define the slide direction; 'up_down': top to down, or 'down_up': below the view to upwards. | ||
DraggableAnimationConfig | TBD | TBD | TBD |
AnimationWrapperView also gives you the capability to define your custom animation using JSON. This tool is very powerful as it allows you to play with various transformation attributes that can be applied to any Animated.View.
TransformDef
object defines an individual piece of transformation, f
(from) to t
(to) value and the p
(property) to transform.TransformDef
along with the duration
and the InterpolationDef
will create an AnimationDef
object. All the transformations defined in the array will play in parallel.AnimationDef
definitions can be played in sequence to render any type of animation (limited by imagination :P).Type definitions:
Type name | params | usage |
---|---|---|
TransformDef | property: TransformType | Defines the property to transform: scale, fade, opacity, translateY, rotate, translateX, rotateX, rotateY , scaleX, scaleY |
to:number | The starting value of the transformation | |
from:number | The final value of transformation after animation |
Type name | params | usage |
---|---|---|
InterpolationDef | easing: EasingType | Defines the easing that will be applied to the transformation set: linear, quad, circle, elastic, bounce, back. |
params: InterpolationParams | Some easing functions require extra params, we use this object to populate the optional params for easing functions, please note if a non optional param is not provided for the specified easing function, it will fallback to linear easing. |
Type name | params | usage |
---|---|---|
InterpolationParams | back: number | https://reactnative.dev/docs/easing#back |
bounciness: number | https://reactnative.dev/docs/easing#bounce | |
bezierCurvePoints: Array<[x1: number, y1: number, x2: number, y2: number]> | https://cubic-bezier.com/ |
Type name | params | usage |
---|---|---|
AnimationDef | TransformDef[] | An array of transformation functions can be defined, that will be applied to the object in parallel |
duration | Duration in which the set of transformations complete animating. | |
InterpolationDef | This param will describe the easing function that will be applied to this set of transformations. |
Multiple set of transformations can be played in a sequence.
1const animationConfig: JsonAnimationConfig = { 2 type: AnimationType.JSON, 3 triggerType: AnimationTriggerType.ON_LOAD, 4 animationConfig: { 5 transforms: [ 6 { 7 key: 'scale', 8 from: 0, 9 to: 1, 10 }, 11 { 12 key: 'rotate', 13 from: 0, 14 to: 90, 15 }, 16 { 17 key: 'rotateX', 18 from: 0, 19 to: 180, 20 } 21 ], 22 duration: 1000, 23 interpolation: { 24 easing: "linear" 25 } 26 } 27 }; 28<AnimationWrapperView animationConfig={bounceConfig}> 29 {/* {your component} */} 30</AnimationWrapperView>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/17 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
18 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More