Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add scroll direction option to useLottieInteractivity hook #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

creativoma
Copy link

Description

This Pull Request introduces an enhancement to the useLottieInteractivity hook by adding an option to specify the scroll direction. This improvement allows users to set the scroll direction to horizontal, making it compatible with smooth scroll libraries such as Lenis.

Background

While integrating lottie-react with Lenis for smooth horizontal scrolling, I encountered the need to adapt the useLottieInteractivity hook to function correctly with horizontal scroll behavior. By adding a scroll direction option, the hook now supports both vertical and horizontal scrolling, providing greater flexibility and functionality for various scrolling use cases.

Changes

  • Added a scrollDirection parameter to the useLottieInteractivity hook.
  • Updated the hook to handle both vertical and horizontal scroll directions.
  • Ensured backward compatibility by defaulting the scroll direction to vertical.
  • This enhancement enables seamless integration of Lottie animations with smooth horizontal scrolling, expanding the usability of the useLottieInteractivity hook in projects requiring different scroll directions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant