Node API

Svelte Node props, callbacks, resize configuration, and object access.

Node renders a draggable node element and owns (or adopts) a core NodeMirror.

PropMeaning
idStable domain identity; minted when omitted — supply it for persistence
nodeObjectAdopt an existing NodeMirror instead of creating one
x, y, width, heightWorld geometry; changed props resynchronize the object
resizableEnable resize handles (default false)
minWidth, minHeightResize floor
resizeHandlestrue for all handles, or a subset of "n" \| "ne" \| "e" \| "se" \| "s" \| "sw" \| "w" \| "nw"
resizeHandleThicknessHandle hit area in pixels (default 14)
resizeCursorsPer-handle cursor overrides
metadataSnapLineMetadata attached to the node
callbacksNodeCallbacks object (drag, selection, resize, lines)
onGeometryChangedConvenience callback; batched final geometry for persistence
onSizeChangeConvenience callback for resize events
edgePanPan the camera when dragging near the viewport edge (default true)
LineSvelteComponentCustom line renderer used for this node’s outgoing lines (defaults to Line)
classNameClass for the outer node element
elementPropsFramework-native attributes and events for the outer node element
childrenNode content; Connector children register against this node

getNodeObject() returns the underlying NodeMirror. A supplied nodeObject is not destroyed on unmount.

Convenience callbacks compose with their callbacks-object equivalents rather than replacing them. During a live pointer gesture, core writes retained element geometry directly; the batched onGeometryChanged reports final values for application persistence.

The rendered element carries data-snapline-type="node" and data-selected / data-snapline-state="focus" | "idle" for styling.