zapier/react-stickydiv

Name: react-stickydiv

Owner: Zapier

Description: React Component which keeps any HTML element sticky whenever it is scrolled beyond view

Created: 2015-04-24 19:33:31.0

Updated: 2016-01-28 05:11:13.0

Pushed: 2016-01-28 18:28:41.0

Homepage:

Size: 58

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Sticky Div

React Component that sets a div (or any HTML element) sticky when it's scrolled beyond view.

Demo at http://learnreact.robbestad.com/#/stickydiv

Installation
% npm install react-stickydiv --save
A note about index.js

The compiled version of the script is automatically created by running:

make jsx

There's no need to update this manually.

Usage
Options With JSX
var StickyDiv = require('react-stickydiv');

MyComponent = React.createClass({
  render: function() {
     return (
       <StickyDiv>
         I'm Sticky
       </StickyDiv>
    );
  }
});
Without JSX
  var MyComponent = React.createClass({
      render: function() {
          return React.createElement(StickyDiv, null, React.createElement("div", null, "I'm Sticky"));
      }
  });

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.