Skip to content

Mouse Pointer Visualizer

import { startMousePointerVisualizer } from "webotron/plugins/mouse-pointer-visualizer";
  • startMousePointerVisualizer(view, options?)
const pointer = await startMousePointerVisualizer(view, {
color: "#ff3b30",
withLabel: true,
trackPageMouseMoves: true,
});
await pointer.moveTo(300, 200);
await pointer.visualizeClick("left"); // pulse only, no actual page click
await pointer.click();
await pointer.stop();
  • moveTo(x, y, options?)
  • moveBy(dx, dy, options?)
  • visualizeClick(button?, clickCount?): shows click pulse overlay only; does not dispatch mouse events.
  • click(button?, clickCount?): dispatches real mouse events and visual pulse.
  • scroll(dx, dy)
  • setVisible(visible)
  • onMove(handler)
  • getPosition()
  • stop()
OptionTypePurpose
colorstringCursor overlay color.
sizenumberCursor overlay size in pixels.
withLabelbooleanShow position label beside cursor.
trackPageMouseMovesbooleanForward page-originated pointer movement events.
  • Renders a cursor overlay in the page.
  • Supports animated movement and optional labels.
  • Can track page-originated pointer moves through a binding.