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
});
Property | Type | Description |
---|---|---|
width | integer | Width dimension of the popup in px |
height | integer | Height dimension of the popup in px |
render | function | Add 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 |
onClose | function | Callback when the popup is closing |
closeOnEsc | boolean | Escape key closes the popup |
closeOnClickOutside | boolean | Clicking outside of the popup closes the popup |
Updated over 3 years ago