Flow APIs

Draggable HTML Elements

Data Attributes

The following attributes can be added to HTML elements of your widgets to enable functions that would normally require complex JavaScript to accomplish.

data-dragtarget="my_unique_id"

Can be assigned to the HTML element to be moved (like a window or a box with data). The element must have the following style: position: absolute;. Can be added or removed dynamically throughout the lifecycle of the widget.

data-dragarea="my_unique_id"

The area that will be dragged by the user (like a top-bar or a draggable part of a window or box) to move the target element. Can be the same or different than the target element (that has the data-dragtarget attribute with matching value (id)). Can be added or removed dynamically throughout the lifecycle of the widget.

data-defaultx="40"

Default X position of the element in percentage of the screen width. The element must have the following style: position: absolute;

data-defaulty="40"

Default Y position of the element in percentage of the screen height. The element must have the following style: position: absolute;

data-defaultoffsetx="4"

X offset in em units from the defaultx. Can be positive or negative. The element must have the following style: position: absolute;

data-defaultoffsety="4"

Y offset in em units from the defaultx. Can be positive or negative. The element must have the following style: position: absolute;

Community of Makers

Our Discord has evolved into a vibrant hub for widget creators. Seek answers to your questions, and showcase your innovative widgets to a community of passionate makers.