Widget

Learn the specifics of developing a widget plugin.

Create the file structure

Set up a directory structure with the following files:

β”œβ”€β”€ src
β”‚   β”œβ”€β”€ static                    
β”‚   β”‚   β”œβ”€β”€ widget.css      
β”‚   β”‚   β”œβ”€β”€ widget.html 
β”‚   β”‚   β”œβ”€β”€ widget.js             
β”‚   β”œβ”€β”€ view.xml
β”‚   β”œβ”€β”€ view_widget.xml
β”‚   β”œβ”€β”€ control.py
β”‚   β”œβ”€β”€ function.py
β”‚   β”œβ”€β”€ user_code.py  
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ manifest.toml

widget.html, widget.css, and widget.js scripts

Fill these files with the content you need according to the table below, then save them.

File
Purpose

widget.html

Define the widget's component layout

widget.css

Define the widget's component styles

widget.js

Define the widget's logic and dynamically modify its styles.

Widgets execute in the user's web browser as client-side applications. Runtime selection only applies to the server-side scripts control, function, and user_code.

view.xml

At the moment, this file is not fully implemented for widget plugins, so it is not relevant to this plugin type. However, it must contain dummy but valid data so the plugin can be deployed. For this reason, you can use the following view.xml file as a dummy file during widget plugin development:

view_widget.xml

Fill this file with the content you want to display when the user creates the widget in the dashboard.

LICENSE and README.md

Write the contents of the README.md and LICENSE files.

manifest.toml

Fill this file according to the Widget section of the Private Plugins page. manifest.toml should look like this:

Compressing the files

Compress the files into a ZIP archive from the root of the file structure, not the parent folder.

Last updated

Was this helpful?