
Research
/Security News
OpenAPI React Query Codegen Compromised in Mini Shai-Hulud npm Supply Chain Attack
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.
@neodrag/solid
Advanced tools
A lightweight SolidJS library to make your elements draggable.
useDraggable hookcreateCompartment for reactive plugin updatesnpm install @neodrag/solid@next
Basic usage
import { useDraggable } from '@neodrag/solid';
export const App: Component = () => {
const [draggableRef, setDraggableRef] = createSignal<HTMLElement | null>(null);
useDraggable(draggableRef);
return <div ref={setDraggableRef}>You can drag me</div>;
};
With plugins
import { useDraggable, axis, grid } from '@neodrag/solid';
export const App: Component = () => {
const [draggableRef, setDraggableRef] = createSignal<HTMLElement | null>(null);
useDraggable(draggableRef, [axis('x'), grid([10, 10])]);
return <div ref={setDraggableRef}>Horizontal grid snapping</div>;
};
Defining plugins elsewhere with TypeScript
import { useDraggable, axis, bounds, BoundsFrom, type Plugin } from '@neodrag/solid';
export const App: Component = () => {
const [draggableRef, setDraggableRef] = createSignal<HTMLElement | null>(null);
const plugins: Plugin[] = [axis('y'), bounds(BoundsFrom.parent())];
useDraggable(draggableRef, plugins);
return <div ref={setDraggableRef}>Type-safe dragging</div>;
};
Getting drag state
import { useDraggable } from '@neodrag/solid';
export const App: Component = () => {
const [draggableRef, setDraggableRef] = createSignal<HTMLElement | null>(null);
const dragState = useDraggable(draggableRef);
createEffect(() => {
console.log('Position:', dragState().offset);
console.log('Is dragging:', dragState().isDragging);
});
return <div ref={setDraggableRef}>Check console while dragging</div>;
};
Reactive plugins with createCompartment
import { createSignal } from 'solid-js';
import { useDraggable, axis, createCompartment } from '@neodrag/solid';
export const App: Component = () => {
const [draggableRef, setDraggableRef] = createSignal<HTMLElement | null>(null);
const [currentAxis, setCurrentAxis] = createSignal<'x' | 'y'>('x');
const axisCompartment = createCompartment(() => axis(currentAxis()));
useDraggable(draggableRef, [axisCompartment]);
return (
<div>
<div ref={setDraggableRef}>Current axis: {currentAxis()}</div>
<button onClick={() => setCurrentAxis(currentAxis() === 'x' ? 'y' : 'x')}>Switch Axis</button>
</div>
);
};
Inspired by react-draggable, but with a modern plugin architecture and optimized for performance.
MIT License © Puru Vijay
FAQs
SolidJS library to add dragging to your apps 😉
The npm package @neodrag/solid receives a total of 175,667 weekly downloads. As such, @neodrag/solid popularity was classified as popular.
We found that @neodrag/solid 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.

Research
/Security News
Ten malicious OpenAPI React Query Codegen versions were published to npm in the Mini Shai-Hulud attack, all with valid provenance.

Security News
Socket joins more than 100 technology, cybersecurity, and financial organizations calling for a global surge in cyber defense.

Product
Enterprise security teams can now detect malware, credential theft, suspicious network activity, and risky updates across Microsoft Edge extensions.