Novelty Polygonal Mathematics
Wondering what’s next for npm?Check out our public roadmap! »

react-now-you-see-me

1.5.25 • Public • Published

react-now-you-see-me

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

npm version CircleCI Known Vulnerabilities Coverage Status


Installation

npm i react-now-you-see-me

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

Usage

import * as 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

12

Version

1.5.25

License

MIT

Unpacked Size

40.3 kB

Total Files

8

Last publish

Collaborators

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