Memento JavaScript UI
Overview
The ui() method is a JavaScript API provided by Memento Database that grants access to a framework of methods and objects for creating user interfaces (UIs) within Memento widgets. With this method, developers can create various UI elements such as text labels, buttons, images, layers, and checkboxes.
Example Usage
ui().text('Hello, world!');
In this example, the ui() method is called to create a new UI object, which is then used to create a text label with the text "Hello, world!".
Notes
A script must return one UI object. If you want to display multiple UI objects, you can use a layout object, which can hold multiple objects. Example usage of a layout object:
ui().layout([
ui().text('This is a text label'),
ui().button('Click me!'),
ui().image('https://example.com/myimage.png')
]);
In this example, the layout object is created by calling the layout() method on a UI object and passing in multiple UI objects as arguments. The layout object contains a text label, a button, and an image, which are grouped together within a single view.