🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@stnew/animation-wrapper

Package Overview
Dependencies
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stnew/animation-wrapper

Wrapper component to animate page elements when they become visible on the screen.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
4
Created
Source

@stnew/animation-wrapper

Component that wraps other content and runs an animation on the content when it becomes visible on the page.

npm install @stnew/animation-wrapper
import { AnimationWrapper } from '@stnew/animation-wrapper';

const AnimatedComponent = () => (
  <AnimationWrapper>
    <p>Hello world!</p>
  </AnimationWrapper>
)
PropsTypeDefaultDesc
childrenReacChildrenundefinedElement(s) to be animated. *Required
rootElement0pxroot option passed to IntersectionObserver.
rootMarginstring0pxrootMargin option passed to IntersectionObserver.
thresholdnumber0threshold option passed to IntersectionObserver.
generalClassstringanimationcss class to be applied at all times to the wrapper component.
finalClassstringanimation-tocss class to be applied to the wrapper component once the content comes into view.
initialClassstringanimation-fromcss class to be applied to the wrapper component before the content comes into view.
delaynumber0time (in milliseconds) between when the element comes into view and when the finalClass gets applied.
heightDelayMultnumber1if multiple AnimationWrapper components are in view when the page loads, their animations are delayed by an amount relative to how far they are from the top of the page. heightDelayMult can increase or increase this offset. A value of 0 will remove the delay.

FAQs

Package last updated on 29 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts