Skip to Content
API ReferenceDraggablePanel

DraggablePanel

A floating panel that the user can drag freely within the root container. Attaches directly to the root like Modal. Drag is handled entirely in the painter via pointer events on the title bar; position and size updates mutate native styles directly without triggering a framework rebuild.

Constructor

DraggablePanel

Creates a DraggablePanel.

ParameterDescription
childThe content displayed inside the panel. Must not be null.
initialXInitial left position in logical pixels.
initialYInitial top position in logical pixels.
titleOptional title shown in the drag handle bar.
widthOptional initial width. Null means size-to-content.
heightOptional initial height. Null means size-to-content.
onCloseOptional close button callback.
resizableWhether a resize grip is shown. Defaults to false.
minWidthMinimum width when resizable. Defaults to 120.
maxWidthMaximum width when resizable. Defaults to unbounded.
minHeightMinimum height when resizable. Defaults to 80.
maxHeightMaximum height when resizable. Defaults to unbounded.
keyAn optional key for reconciliation identity.

Properties

Height

Initial height of the panel in logical pixels. When null the panel sizes to its content height.

InitialX

Initial horizontal position in logical pixels from the left of the root container.

InitialY

Initial vertical position in logical pixels from the top of the root container.

MaxHeight

Maximum height in logical pixels when resizable. Defaults to float.MaxValue (unbounded).

MaxWidth

Maximum width in logical pixels when resizable. Defaults to float.MaxValue (unbounded).

MinHeight

Minimum height in logical pixels when resizable. Defaults to 80.

MinWidth

Minimum width in logical pixels when resizable. Defaults to 120.

OnClose

Optional callback invoked when the user presses the close button. When null no close button is rendered.

Resizable

When true a resize grip is rendered in the bottom-right corner and the user can drag it to resize the panel.

Title

Optional title displayed in the drag handle bar.

Width

Initial width of the panel in logical pixels. When null the panel sizes to its content width.

Last updated on