Gathering detailed insights and metrics for react-mount-animation
Gathering detailed insights and metrics for react-mount-animation
Gathering detailed insights and metrics for react-mount-animation
Gathering detailed insights and metrics for react-mount-animation
mount-animation-react
* When element is unmounted, that element performs an event and then disappears. * There are 3 conditions for an element to disappear. * js setTimeout : Set duration millisecond for fade out. * css animation : Set ref on fade-out animation elem
react-mount-unmount-animation
Lightweight React library to animate mounting and unmounting elements created with TypeScript and styled-components
animation-wrapper
A Wrapper that animates the children on mount and unmount and destroy itself after unmount
react-native-curtains
Lightweight helper lib for mounting + unmounting of child elements in an animated 'curtain' style
Add animations as you would from CSS (using keyframes) when mounting and unmounting React components with a very clear and easy syntax.
npm install react-mount-animation
Typescript
Module System
Node Version
NPM Version
65.5
Supply Chain
92.3
Quality
77.6
Maintenance
100
Vulnerability
100
License
TypeScript (75.14%)
JavaScript (23.66%)
HTML (1.2%)
Total Downloads
60,252
Last Day
12
Last Week
107
Last Month
622
Last Year
15,578
MIT License
8 Stars
26 Commits
4 Forks
2 Watchers
1 Branches
2 Contributors
Updated on Apr 24, 2025
Minified
Minified + Gzipped
Latest Version
0.0.11
Package Id
react-mount-animation@0.0.11
Unpacked Size
21.55 kB
Size
6.58 kB
File Count
8
NPM Version
8.1.4
Node Version
16.13.0
Cumulative downloads
Total Downloads
Last Day
9.1%
12
Compared to previous day
Last Week
9.2%
107
Compared to previous week
Last Month
-22.5%
622
Compared to previous month
Last Year
-28.7%
15,578
Compared to previous year
1
32
Add animations as you would from CSS (using keyframes) when mounting and unmounting React components with a very clear and easy syntax. The 'react-mount-animation' component takes care of mounting and unmounting the component through the 'show' attribute and executing the animations.
Instead of this (mount/unmount without animation):
1const MyComponent = () => { 2 const [isMounted, setIsMounted] = useState(false); 3 4 ... 5 6 return ( 7 <> 8 {isMounted && ( 9 <div> 10 Hi World! 11 </div> 12 )} 13 </> 14) 15...
We do this (same with animation):
1import Animated from "react-mount-animation"; 2 3const MyComponent = () => { 4 const [isMounted, setIsMounted] = useState(false); 5 6 ... 7 8 return ( 9 <Animated.div //You can use any HTML element here 10 show={isMounted} 11 mountAnim={` 12 0% {opacity: 0} 13 100% {opacity: 1} 14 `} 15 > 16 Hi World! 17 </Animated.div> 18) 19...
1import Animated from "react-mount-animation"; 2 3const mountAnimation1 = ` 4 0% {border-radius: 4px} 5 0% {opacity: 0} 6 0% {font-size: 12px} 7 10% {opacity: 0} 8 35% {font-size: 12px} 9 60% {font-size: 24px} 10 70% {border-radius: 4px} 11 70% {box-shadow: 0px 0px 0px 0px rgba(0,0,0,0), inset 0px 0px 2px 2px rgba(255,255,255,0)} 12 100% {opacity: 1} 13 100% {box-shadow: 0px 0px 13px 4px rgba(0,0,0,1), inset 0px 0px 2px 2px rgba(255,255,255,0.2)} 14 ` 15 16const unmountAnimation1 = ` 17 0% { opacity: 1; } 18 10% { transform: rotate(-20deg); } 19 100% {opacity: 0;} 20 ` 21 22const mountAnimation2 = ` 23 60% {transform: translate(0px, 0)} 24 85% {transform: translate(10px, 0)} 25` 26 27const MyComponent = () => { 28 const [isMounted, setIsMounted] = useState(false); 29 30 ... 31 32 return ( 33 <> 34 <button onClick={() => setIsMounted(!isMounted)}> 35 Mount/Unmount 36 </button> 37 <Animated.div 38 show={isMounted} 39 mountAnim={mountAnimation1} 40 unmountAnim={unmountAnimation1} 41 style={{ 42 fontSize: 24, 43 color: "white", 44 backgroundColor: "black", 45 padding: 20, 46 borderRadius: 20, 47 boxShadow: 48 "0px 0px 13px 4px rgba(0,0,0,1), inset 0px 0px 2px 2px rgba(255,255,255,0.2)", 49 }} 50 > 51 <Animated.div 52 show={isMounted} 53 mountAnim={mountAnimation2} 54 time={1.1} 55 > 56 Hi! This is a test component 😝 57 </Animated.div> 58 </Animated.div> 59 </> 60) 61...
name | type | description |
---|---|---|
show* | boolean | Used to indicate when the component has to be mounted and unmounted. |
time | number | The total duration of the mount animation. Default 1. |
unmountTime | number | The total duration of the unmount animation. By default it takes the time prop. |
delay | number | The total delay of the mount animation. Default 0. |
unmountDelay | number | The total delay of the unmount animation. By default it takes the delay prop. |
mountAnim* | string | Mount animation indicated as string just like CSS keyframes. |
unmountAnim | string | Unmount animation indicated as string just like CSS keyframes. If this prop is not filled, the component will execute the mountAnim reversed when unmount. |
mountAnimId | string | If you don't want to use mountAnim, you can specify the name of a keyframe defined in a CSS file. This will override mountAnim. |
unmountAnimId | string | If you don't want to use unmountAnim, you can specify the name of a keyframe defined in a CSS file. This will override unmountAnim. |
onAnimationEnd | function | Callback fired when the component ends its animation (mount or unmount). |
onMountEnd | function | Callback fired when the component ends its mount animation |
onUnmountEnd | function | Callback fired when the component ends its unmount animation |
You are invited to collaborate 😋, if you are interested, you can contact me through migueljimenezbenajes@gmail.com.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/20 approved changesets -- score normalized to 1
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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
90 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-05
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