
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
react-hover-slop
Advanced tools
Expand the area of the mouseOver, mouseLeave and mouseEnter events for React components. Usefull for if you want to prefetch earlier than regular hover
A React hook that expands the area of the mouseOver, mouseLeave and mouseEnter events for React components. Usefull for if you want to prefetch earlier than regular hover
npm install react-hover-slop
# or
yarn add react-hover-slop
# or
pnpm add react-hover-slop
import { useRef } from 'react';
import useHoverslop from 'react-hover-slop';
function MyComponent() {
const buttonRef = useRef(null);
const { isHovered } = useHoverslop(
buttonRef,
{ top: 20, right: 20, bottom: 20, left: 20 }, // Extend hover hitbox 20px in all directions
{
onMouseEnter: () => console.log('Mouse entered extended area'),
onMouseLeave: () => console.log('Mouse left extended area'),
}
);
return (
<button
ref={buttonRef}
style={{
backgroundColor: isHovered ? 'blue' : 'gray',
transition: 'background-color 0.3s'
}}
>
Hover Me
</button>
);
}
useHoverslop(elementRef, hoverslopBox, mouseEvents, debugMode?)elementRef: React ref to the target elementhoverslopBox: Either a number (applies to all sides) or an object with optional top, right, bottom, and left propertiesmouseEvents: Object containing optional callback functions:
onMouseEnter: Called when the cursor enters the extended areaonMouseOver: Called repeatedly while the cursor is in the extended areaonMouseLeave: Called when the cursor leaves the extended areadebugMode: Boolean to enable visual debugging of hover areas (optional)isHovered: Boolean indicating whether the cursor is within the extended areaAdds a visual border around the element for debugging your slop boxes.
MIT
FAQs
Expand the area of the mouseOver, mouseLeave and mouseEnter events for React components. Usefull for if you want to prefetch earlier than regular hover
The npm package react-hover-slop receives a total of 5 weekly downloads. As such, react-hover-slop popularity was classified as not popular.
We found that react-hover-slop demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.