Floating
API reference for floating UI components and hooks.
Installation
npm install @udecode/plate-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 Slate range.
getSelectionBoundingClientRect
Gets the bounding client rectangle of the current editor selection.