
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
react-sticky
Advanced tools
A simple React component polyfill for making any mounted component on your page sticky.
npm install react-sticky
First, you will want to wrap the element you want to be sticky with tags. When the element is scrolled past the point where it would start to move off screen, the stickiness is activated.
app.jsx
var React = require('react'),
Sticky = require('react-sticky');
var Header = React.createClass({
render: function() {
return (
<Sticky>
<header>
<nav />
</header>
</Sticky>
);
},
});
When the "stickiness" becomes activated, the following css style rules are applied to the Sticky element:
position: fixed;
top: 0;
left: 0;
right: 0;
In the event that you wish to override the style rules applied, simply pass in the style object as a prop:
app.jsx
<Sticky stickyStyle={customStyleObject}>
<header />
</Sticky>
Note: For more information on the style object see http://facebook.github.io/react/tips/inline-styles.html
A more in-depth example is included, but you will need to build it first using the following command:
scripts/build-example
Captivation Software (@teamcaptivation)
Aaron Goin
By all means, if you see room for improvement, let us know!
MIT License
FAQs
Sticky component for React
The npm package react-sticky receives a total of 87,878 weekly downloads. As such, react-sticky popularity was classified as popular.
We found that react-sticky demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.