useEventListener
import { useEventListener, Group, type PibblNode } from "@pibbl/core";useEventListener(handlers) accepts PibblEventHandlers, is render-only, and updates propagation listeners
for the current component identity. It does not define hit geometry; combine it
with a primitive target or useEventTarget. Pibbl owns the listener registration
and releases it on replacement or component teardown.
function Panel({ children }: { children: PibblNode }) { useEventListener({ onClickCapture: (event) => console.log(event.type) }); return <Group>{children}</Group>;}See the Propagation and cancellation live example.
Container children use PibblNode.
API details from source
Section titled “API details from source”
Registers the current component’s event handlers with mount-owned cleanup.
useEventListener: (handlers: PibblEventHandlers) => voidRelated API: useEventListener, PibblEventHandlers.
Parameters
Section titled “Parameters”handlers— Handlers to register for the current component’s event participation. See PibblEventHandlers .
See also
Section titled “See also”View source — packages/core/src/lib/hooks/use-event-listener.ts:19
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the Input, focus, and native HTML companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Typed event target: A geometric Canvas target routes pointer, mouse, touch, wheel, keyboard, input, clipboard, and drag events. Plain source
Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 2dccb19. ALPHA — NOT FOR PRODUCTION USE.