Widgets
## Introduction
Widgets are visual elements embedded into Torii.
You can add widgets to your plugin using the `widgets` section within your manifest file.
Plugins that support widgets will have a Widgets tab to preview the added functionality after installation:

Once the plugin is installed and data is available, the widget will appear on the Overview tab when viewing an application:

## Widget Schema
Every element within the `widgets` section should include the following properties:
| Property | Mandatory | Description | Example |
| :------- | :-------- | :-------------------------------------------------------------------------------------------------------- | :------- |
| type | ✅ | The type of the widget. (See the Widget Types section below for more details). | KeyValue |
| fields | ✅ | List of fields to be displayed within the widget. (See the Widget Fields section below for more details). | |
### Widget Types
- KeyValue - this widget displays its list of fields as key-value pairs, where the key is the field’s label and the value is the field’s value.

### Widget Fields
An array of fields to be displayed within the widget.
[block:parameters]
{
"data": {
"h-0": "Property",
"h-1": "Mandatory",
"h-2": "Description",
"h-3": "Example",
"0-0": "key",
"0-1": "✅",
"0-2": "A unique key, pointing to one of the keys defined within the app fields list. \nMust match the pattern: `app.<key>`",
"0-3": "app.username",
"1-0": "template",
"1-1": "",
"1-2": "Use this if you want to alter the way the value is displayed. \nThe format is: `{{value}}`",
"1-3": "`{{value / 100}}` \n \nFor: value = 5, \nit will show: 5 / 100"
},
"cols": 4,
"rows": 2,
"align": [
"left",
"left",
"left",
"left"
]
}
[/block]
## Limitations
- Widgets can only be added if the `app` section is defined within the manifest.
Updated 11 days ago