Platform UI

Use platform.ui to create and modify UI elements in the editor.

Popups

The platform.ui.openPopup method opens a popup to display content to the user in the editor.

const render = ({key, close, container}) => {
    container.innerHTML = 'Hi there from within popup'; 
};

platform.ui.openPopup('my-popup-key', {
    height: 400, width: 600, render
});
PropertyTypeDescription
widthintegerWidth dimension of the popup in px
heightintegerHeight dimension of the popup in px
renderfunctionAdd custom content and behavior to the popup by using this function to return the popup element.

Arguments:
key → popup's key
close → close handler function to close the popup
container → popup container DOM element
onClosefunctionCallback when the popup is closing
closeOnEscbooleanEscape key closes the popup
closeOnClickOutsidebooleanClicking outside of the popup closes the popup

What’s Next