# react-stickydiv **Repository Path**: mirrors_svenanders/react-stickydiv ## Basic Information - **Project Name**: react-stickydiv - **Description**: React Component which keeps any HTML element sticky whenever it is scrolled beyond view - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-18 - **Last Updated**: 2026-01-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Sticky Div [React][1] Component that sets a div (or any HTML element) sticky when it's scrolled beyond view. Demo at [http://learnreact.robbestad.com/#/stickydiv][2] ## 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 * {int} offsetTop - The offset from the top of the page, optional; default: 0 * {int} zIndex - The zIndex for the sticky element, optional; default: 999 * {function} onFixedChange - Function called on change on sticky state, optional; * {string} className - A className (or names) for the sticky element, optional; default: '' #### With JSX var StickyDiv = require('react-stickydiv'); MyComponent = React.createClass({ render: function() { return ( I'm Sticky ); } }); #### Without JSX var MyComponent = React.createClass({ render: function() { return React.createElement(StickyDiv, null, React.createElement("div", null, "I'm Sticky")); } }); [1]: https://facebook.github.io/react [2]: http://learnreact.robbestad.com/#/stickydiv [3]: https://github.com/svenanders/react-stickydiv/issues/1 [4]: https://gist.github.com/z5h/d95304d8d8e1fb6d0619