
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
react-scroll-ondrag
Advanced tools
Scroll your elements by dragging your mouse
You can see the simplest demo here: Live demo
$ npm install --save react-scroll-ondrag
Run examples:
$ cd examples
$ npm install
$ npm start
import React, { useRef } from 'react';
import useScrollOnDrag from 'react-scroll-ondrag';
const App = () => {
const ref = useRef();
const { events } = useScrollOnDrag(ref);
return <div {...events} ref={ref} />;
};
Type: a React ref
, required
A ref
to the DOM element whose scroll position you want to control
Type: object
Type: function: () => void
Called when scrolling by dragging starts
Type: function: () => void
Called when scrolling by dragging ends
Type: object
, shape: { events: { onMouseDown } }
An object with the events to inject to the controlled element.
See the LICENSE file for license rights and limitations (MIT).
FAQs
React library for scrolling elements by dragging the mouse
The npm package react-scroll-ondrag receives a total of 1,412 weekly downloads. As such, react-scroll-ondrag popularity was classified as popular.
We found that react-scroll-ondrag demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.