2.0.1 • Published 5 years ago

react-keep-visible v2.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Keep Visible

React Keep Visible BETA

Keep an element in the viewport (within the bounds of its parent container) while the user scrolls.

Similar to position 'sticky', except it intelligently switches between sticking to the top and bottom edge to allow scrolling through the entire element.

live demo

Vanilla sticky counter example: demo

Installation

npm install react-keep-visible

or

yarn add react-keep-visible

Usage

      <KeepVisible>
        [ element ]
      </KeepVisible>

Notes

To do: support 'top' & 'bottom' offsets.

Margins added to the element kept visible will negatively impact positioning. Try padding instead.

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago