Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Latest commit

 

History

History
31 lines (24 loc) · 591 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 591 Bytes

react-stickyfill

React wrapper for Stickyfill library

Installation

npm install react-stickyfill --save

Usage

Simple usage:

import React from 'react';
import Sticker from 'Stickyfill';

const SomeComponent = React.createClass({
	render(){
		return (
			<div>{/* Parent Element. */}
				<Sticker>
					<div>{/* Sticky Element */}</div>
				</Sticker>
			</div>
		);
	}
});

Parent Element should have height greater than Sticky Element. Sticky Element should have style position: sticky and top: {some value}.