Noncollinear Perpendicular Microcrystalline
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

react-now-you-see-me

1.4.3 • Public • Published

react-now-you-see-me

A React component for determining when an element is within a given threshold of the viewport, horizontally.


Installation

npm i react-now-you-see-me

You'll also need React and ReactDOM peer dependencies: npm i react react-dom.

Usage

import React from 'react'
import InView from 'react-now-you-see-me'
 
const Foo = (props) => (
  <SomeCarouselComponent>
    {someSlides.map((_, i) =>
      <InView key={i} threshold={0} boundingLeft={100} boundingRight={100}>
        {(isInView) =>
          isInView
            ? <span>I am totally in view right now, awesome!</span>
            : <span>You can't see me :(</span>
        }
      </InView>
    )}
  </SomeCarouselComponent>
)

LICENSE

MIT

install

npm i react-now-you-see-me

Downloadsweekly downloads

17

version

1.4.3

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar