Skip to content

How to set offsets and targets with useScroll? #39

Description

@simpel

Hello!

How can I use the useScroll hook provided to detect when a element is in view. I.e how can I use this package to achieve the same thing as you can do with framer motion useScroll

const { scrollYProgress } = useScroll({
   target: ref,
   offset: ['start end', '0.4 0.9']
});

I'd like to apply a target and offsets so I can animate elements based on their position in the viewport

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions