New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@elementor/editor-floating-panels

Package Overview
Dependencies
Maintainers
4
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elementor/editor-floating-panels

A generic floating panel framework for the Elementor Editor that provides the primitives for rendering panels on the canvas. The panels can be dragged and resized freely within the viewport, independent of any specific feature concern.

latest
Source
npmnpm
Version
4.3.2
Version published
Weekly downloads
245
-76.64%
Maintainers
4
Weekly downloads
 
Created
Source

Editor Floating Panels

A generic floating panel framework for the Elementor Editor that provides the primitives for rendering panels on the canvas. The panels can be dragged and resized freely within the viewport, independent of any specific feature concern.

The panes are persisted and survive reloads. The state stores open/closed, position, size, and z-index in localStorage.

Usage

import {
	createFloatingPanel,
	init,
	registerFloatingPanel,

	FloatingPanelBody,
	FloatingPanelFooter,
	FloatingPanelHeader,
} from '@elementor/editor-floating-panels';

init();

const myPanel = createFloatingPanel( {
	id: 'my-panel',
	title: 'My Panel',
	icon: MyIcon,
	component: MyPanelComponent,
	isDraggable: true,
	isResizable: true,
	defaults: {
		width: 320,
		height: 480,
		minWidth: 240,
		minHeight: 320,
		corner: 'block-start-inline-start',
		initialPosition: {
			insetBlockStart: 80,
			insetInlineStart: 200
		},
	},
} );

registerFloatingPanel( myPanel.panel );

function MyPanelComponent() {
	return (
		<>
			<FloatingPanelHeader
				panelId="my-panel"
				title="My Panel"
				actions={ [ /* ... */ ] }
			/>
			<FloatingPanelBody>
				{ /* ... */ }
			</FloatingPanelBody>
			<FloatingPanelFooter>
				{ /* ... */ }
			</FloatingPanelFooter>
		</>
	);
}

isDraggable

When isDraggable is true, the panel header acts as a drag handle — the user can reposition the panel freely. When false (the default), the header renders without drag interaction and the panel stays at its initialPosition (see defaults.initialPosition).

Programmatic positioning via setPosition from useFloatingPanelActions works regardless of isDraggable.

isResizable

When isResizable is true, edge and corner resize handles render on the panel — the user can resize freely within the viewport and the minimums defined in defaults (minWidth / minHeight). When false (the default), no resize handles render and the panel stays at its declared or persisted size.

Programmatic sizing via setSize from useFloatingPanelActions works regardless of isResizable.

defaults

defaults is required and defines the panel's initial dimensions and (optionally) its initial position.

FieldPurpose
widthInitial panel width (in pixels).
heightInitial panel height (in pixels).
minWidthMinimum width the panel can be resized to.
minHeightMinimum height the panel can be resized to.
corner (optional)Viewport corner anchor. One of block-start-inline-start, block-start-inline-end, block-end-inline-start, block-end-inline-end. Default: block-start-inline-start.
initialPosition (optional)Offsets on the two insets that match corner. Used only when no persisted position exists. Other keys are ignored.

Sizes use physical names (width/height) because Elementor renders in horizontal writing mode only. Position uses logical inset names because it is direction-sensitive (e.g. RTL).

LogicalPosition stores all four insets (insetInlineStart, insetInlineEnd, insetBlockStart, insetBlockEnd). Only the pair matching corner is used for rendering and interaction; inactive insets are 0.

cornerActive insetsDefault initialPosition
block-start-inline-startinsetInlineStart, insetBlockStart{ insetInlineStart: 24, insetBlockStart: 80 }
block-start-inline-endinsetInlineEnd, insetBlockStart{ insetInlineEnd: 24, insetBlockStart: 80 }
block-end-inline-startinsetInlineStart, insetBlockEnd{ insetInlineStart: 24, insetBlockEnd: 80 }
block-end-inline-endinsetInlineEnd, insetBlockEnd{ insetInlineEnd: 24, insetBlockEnd: 80 }

Example for bottom-right anchoring:

defaults: {
	width: 360,
	height: 600,
	minWidth: 280,
	minHeight: 400,
	corner: 'block-end-inline-end',
	initialPosition: {
		insetBlockEnd: 80,
		insetInlineEnd: 24
	},
}

When persisted state exists, the persisted position, corner, and size override initialPosition, corner, width, and height. The resize minimums (minWidth/minHeight) are always derived from defaults.

Call init() once during editor bootstrap, before any createFloatingPanel call, to register the slice, sync persisted state, and mount the host into the editor's top location.

FAQs

Package last updated on 24 Sep 2026

Related posts