This package provides a set of React components designed to enable smooth and customizable animations for web elements during scrolling and other interactions. Leveraging framer-motion
for fluid animations, these components are highly adaptable for various use cases.
Animates elements based on scroll position.
stiffness
,damping
,restDelta
: Spring animation configuration.offset
: Defines the scroll range for triggering the animation.shouldAnimateOpacity
,shouldAnimateScaleX
, etc.: Boolean props to enable specific animations.offSetOutputRange
,transformOutputRange
,bgColorOutputRange
: Define the output range for the respective animations.
Fades and translates elements into view on scroll.
transitionDelayVelocity
,transitionLength
,transitionTiming
,transitionDelay
: Control the transition timing and delay.useInViewOnce
: Boolean to determine if the animation should only play once.indexOffset
: Adjusts the delay based on the element's index.
Applies ScrollOnView
or TriggerOnScroll
animations to all child elements.
- Inherits all props from
TriggerOnScroll
andScrollOnView
. scrollOnView
: Determines which animation type to use.indexOffset
: Adjusts the index offset for staggered animations.
Recursively applies ScrollOnView
to nested child elements.
transitionDelayVelocity
,transitionLength
,transitionTiming
,transitionDelay
: Control the transition timing and delay.useInViewOnce
: Determines if the animation should only play once.
yarn add easy-chakra-animate
import { TriggerOnScroll, ScrollOnView, AnimateAllChildren, TraverseAndAnimate } from 'easy-chakra-animate';
// Example usage
<AnimateAllChildren>
{list.map((componentData) => (
<DynamicComponent key={componentData.id} componentData={componentData} />
))}
</AnimateAllChildren>
See these components in action here.
- React
- Framer Motion
Contributions are welcome. Please submit a pull request or an issue for any feature requests or bugs.
This project is licensed under the MIT License. See the LICENSE file for details.