Skip to content

Hermanya/use-scroll-to-reveal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

use-scroll-to-reveal

React hook for using scroll to reveal components

NPM JavaScript Style Guide

Install

npm install --save use-scroll-to-reveal

Usage

import React, { useRef } from 'react'

import { useScrollToReveal } from 'use-scroll-to-reveal'

const Example = () => {
  const ref = useRef()
  const revealed = useScrollToReveal(ref)
  return (
    <MyCompnentThatAnimatesWhenRevealedIsTrue
      ref={ref} revealed={revealed}/>
  )
}

License

MIT © Hermanya