use-scroll-to-reveal
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i use-scroll-to-reveal

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

984 kB

Total Files

25

Last publish

Collaborators

  • hermanya