Creates a new ResizableNodeView instance.
The constructor sets up the resize handles, applies initial sizing from node attributes, and configures all resize behavior options.
Configuration options for the resizable node view
CSS class names for elements
The outer container element (returned as NodeView.dom)
OptionalcontentThe editable DOM element inside the DOM
OptionalcreateOptional callback for creating custom resize handles
Active resize handle directions
The Tiptap editor instance
The DOM element being made resizable
Function to get the current node position
OptionalmaxMaximum allowed dimensions (optional)
Minimum allowed dimensions
The ProseMirror node instance
Callback fired when resize completes
OptionalonCallback fired during resize
OptionalonCallback for node updates
Whether to always preserve aspect ratio
The wrapper element that contains the element and handles
Returns the top-level DOM node that should be placed in the editor.
This is required by the ProseMirror NodeView interface. The container includes the wrapper, handles, and the actual content element.
The container element to be inserted into the editor
Creates the outer container element.
The container is the top-level element returned by the NodeView and wraps the entire resizable node. It's set up with flexbox to handle alignment and includes data attributes for styling and identification.
The container element
Creates the wrapper element that contains the content and handles.
The wrapper uses relative positioning so that resize handles can be positioned absolutely within it. This is the direct parent of the content element being made resizable.
The wrapper element
Cleanup method called when the node view is being removed.
Removes all event listeners to prevent memory leaks. This is required by the ProseMirror NodeView interface. If a resize is active when destroy is called, it will be properly cancelled.
Called when the node's content or attributes change.
Updates the internal node reference. If a custom onUpdate callback
was provided, it will be called to handle additional update logic.
The new/updated node
Node decorations
Inner decorations
false if the node type has changed (requires full rebuild), otherwise the result of onUpdate or true
A NodeView implementation that adds resize handles to any DOM element.
This class creates a resizable node view for Tiptap/ProseMirror editors. It wraps your element with resize handles and manages the resize interaction, including aspect ratio preservation, min/max constraints, and keyboard modifiers.
Example