react-animount
v1.0.23
Published
React Component, triggers css animation on mount and unmount component.
Downloads
6
Readme
React AniMount
React Component, triggers css animation on mount and unmount component.
- Library ignores remounting the component.
- Library observing unmounting the component and clones own animated element
- When animation is ended, react component replacing itself
Available animations
getOpacityStartHandle
- opacity animation on startgetOpacityEndHandle
- opacity animation on endgetSlideDownStartHandle
- slideDown animation on startgetSlideDownEndHandle
- slideDown animation on endgetSlideRightStartHandle
- slideRight animation on startgetSlideRightEndHandle
- slideRight animation on endgetSlideUpStartHandle
- slideUp animation on startgetSlideUpEndHandle
- slideUp animation on endgetSlideDownStartHandle
- slideDown animation on startgetSlideDownEndHandle
- slideDown animation on end
Usage
import { Animation, getSlideDownStartHandle, getSlideDownEndHandle } from 'react-animount';
const ANIMATION_DURATION = 200;
export const App = () => (
<Animation
duration={ANIMATION_DURATION}
onAnimationStart={getSlideDownStartHandle(ANIMATION_DURATION)}
onAnimationEnd={getSlideDownEndHandle(ANIMATION_DURATION)}
>
<div>Animated Section On Mount & Unmount</div>
</Animation>
);
Also check typedoc, referenced in Animation.tsx
Contribute
Open to contribute