Overview
Every plugin automatically gets a container — a DOM element managed by the core that provides dragging, resizing, and docking. The container system lets plugins float freely on the board or dock into other elements.api.container (Getter)
Access the current plugin’s container. If it doesn’t exist yet, it’s auto-created with default styling (absolute positioning, draggable, resizable).HTMLElement
api.container is a getter that only works during setup(). It relies on api.getPluginId() to identify the current plugin.api.getContainer(pluginId)
Get a specific plugin’s container element by ID.
Returns:
HTMLElement | null
api.removeContainer(pluginId)
Remove and destroy a plugin’s container. Also cleans up injected CSS.api.mountPlugin(pluginId, targetEl)
Dock a plugin’s container into a target element. The container fills the target (100% width/height, relative positioning).
Emits:
plugin:docked
api.undockPlugin(pluginId)
Undock a plugin from its current docked position and make it float freely on the board.
Emits:
plugin:undocked
When a docked element is dragged, it’s automatically undocked. You don’t need to call
undockPlugin() manually for drag-to-undock behavior.api.updatePlugin(targetPluginId, updater)
Safely modify a plugin’s container element. Checks permissions before applying changes.
Emits:
plugin:updated
api.getPlugin(pluginId)
Get a plugin’s container element. Alias forgetContainer().
Returns:
HTMLElement | null
Container Default Styles
Containers created byapi.container have these defaults:
See Also
- Dragging & Resizing —
makeDraggableandmakeResizable - Permissions — permission system for cross-plugin access
- Built-in Events —
plugin:docked,plugin:undocked, etc.