
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
hover-cursor
Advanced tools
Elevate user experience with seamless cursor interactions using hover-cursor, a small JS library. Create captivating web interfaces by dynamically crafting bespoke hover cursors that you can style however you need.
Elevate user experience with seamless cursor interactions using hover-cursor, a powerful JS library. Create captivating web interfaces by dynamically crafting bespoke hover cursors that you can style however you need.
npm i hover-cursor
yarn add hover-cursor
In your project, import the HoverCursor class like so:
import { HoverCursor } from 'hover-cursor'
Usage:
Note: If the element does not load, make sure you are initialising your HoverCursor after
DOMContentLoaded!
new HoverCursor({
containerQuery: '.floating-video',
snapPosition: 'R'
})
The following code produces the behaviour displayed in the GIF.

import { HoverCursor } from 'hover-cursor'
document.addEventListener('DOMContentLoaded', () => {
function toggleCursor() {
console.log('Function called when element is clicked')
}
new HoverCursor({
containerQuery: '.floating-video',
snapPosition: 'R',
title: 'Sound On',
toggledTitle: 'Sound Off',
toggledFunction: toggleCursor
})
})
div.hover-cursor {
width: 7rem;
height: 7rem;
border-radius: 50%;
background: orange;
}
Documentation is still being made as the libary is still being worked on, but a brief list is below,
| Parameter | Description | Default | Required? |
|---|---|---|---|
| containerQuery | Query to locate the target element(s) (the element[s] that we are watching to be hovered) | ✅ | |
| snapPosition | L, M or R to define the snap position as left, middle or right | 'M' | ❌ |
| customClass | Adds a custom class to the cursor | '' | ❌ |
| title | The title to display in the markup | '' | ❌ |
| toggledTitle | The title to toggle to after the target element (class) is clicked | '' | ❌ |
| icon | The icon src to display in the markup (e.g. ./images/right-arrow.svg) | '' | ❌ |
| toggledIcon | The icon to src toggle to after the target element is clicked | '' | ❌ |
| toggledFunction | A callback function after the user clicked for custom functionality on click | null | ❌ |
I extend a warm invitation to developers and enthusiasts to contribute to hover-cursor. Your insights, expertise, and fresh perspectives are invaluable assets that can help me refine and enhance my work.
To get started, please review my guidelines for contributing, which can be found in the CONTRIBUTING.md file. If you encounter any issues, have questions, or need clarification, don't hesitate to reach out.
FAQs
Elevate user experience with seamless cursor interactions using hover-cursor, a small JS library. Create captivating web interfaces by dynamically crafting bespoke hover cursors that you can style however you need.
We found that hover-cursor 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.