0.0.2 • Published 3 years ago

framer-motion-visible v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Framer Motion - Visible

Utility React hook to trigger framer motion animations when a node is visible in the viewport.

Installation

npm i framer-motion-visible

Usage

function Title({ children }) {
  const visibleAnimation = useVisibleAnimation({
    initial: { x: -40, y: 40, opacity: 0 },
    visible: { x: 0, y: 0, opacity: 1 },
  });

  return <motion.h1 {...visibleAnimation}>{children}</motion.h1>;
}

Development

Uses microbundle for development setup.

Following command for running a dev library build.

npm run dev

Twitter Follow