Skip to main content
Solid Primitives 2

Primitive to manage events in a reactive way.

StageCategoryVersionLast Updated
3Browser APIs1.0.0-next.2 (next)Aug 13, 2026
Terminal window
npm i @solid-primitives/event-props@next

A helpful primitive that creates the event props and a reactive store with the latest events

How to use it

createEventProps

Receive the event props and a props with the latest events:

const [events, eventProps] = createEventProps('mousedown', 'mousemove', 'mouseup');
const isMouseDown = createMemo(() => (events.mousedown?.ts ?? 0) > (events.mouseup?.ts ?? 1));
createEffect(
() => isMouseDown() && events.mousemove,
mousemove => {
if (mousemove) {
console.log(mousemove.clientX, mousemove.clientY);
}
},
);
<div {...eventProps}>Click and drag on me</div>

Changelog

See CHANGELOG.md

Solid Primitives 2High-quality reactive primitives for building applications in Solid2
Community
githubdiscord