Installation
pnpm add @platejs/floating
API Hooks
useVirtualFloating
Creates a floating element with a controlled virtual element, typically used to follow cursor position.
useFloatingToolbar
Creates a floating toolbar that appears when text is selected in the editor.
API
getBoundingClientRect
Gets the bounding client rectangle for a location or array of locations in the editor.
getDOMSelectionBoundingClientRect
getRangeBoundingClientRect
Gets the bounding client rectangle for a specific Plate range.
getSelectionBoundingClientRect
Gets the bounding client rectangle of the current editor selection.