Views
A view is the page a plugin returns from view: a header, notices, one body and a footer.
A view in full
The template's Example page: a header with an import button, a notice, a searchable list with a switch per row, and a footer.
{
"subtitle": "2 items, 1 on",
"actions": [ { "id": "pick", "label": "Import…", "icon": "upload",
"kind": { "pick": { "title": "Import example items", "extensions": ["exmod"], "folders": false, "multiple": true } } } ],
"notices": [ { "text": "Team Simplified is off in this profile.", "tone": "warn",
"action": { "id": "enable", "label": "Turn on" } } ],
"body": { "list": {
"rows": [
{ "id": "okayama.exmod", "title": "okayama.exmod", "subtitle": "41 bytes",
"art": { "monogram": "O" },
"tags": [ { "text": "Track", "tone": "muted" } ],
"trailing": { "switch": { "id": "okayama.exmod", "on": true, "enabled": true } },
"detail": [ { "stats": [ { "label": "Size", "value": "41 bytes" } ] } ] },
{ "id": "suzuka.exmod", "title": "suzuka.exmod", "subtitle": "38 bytes",
"art": { "monogram": "S" },
"trailing": { "switch": { "id": "suzuka.exmod", "on": false, "enabled": true } } }
],
"reorder": false,
"search": { "placeholder": "Search items" } } },
"footer": "By Team Simplified."
}subtitle required the page header's line; a list body also shows its row count
actions buttons in the header
notices bars under the header: { text, tone, action }; tone colours the bar, action is an optional button
body required one of list, empty, blocks
footer a muted line at the end of the page, after the body
tick 1.0.10 true asks for a tick about once a second while the page is open (Live pages); default falseBodies
{ "list": { "rows": [ … ], "reorder": false, "search": { "placeholder": "Search mods" } } }
{ "empty": { "title": "No example items", "text": "Drop a .exmod file on the launcher, or import one.", "action": { "id": "pick", "label": "Import…" } } }
{ "blocks": [ … ] }list: rows with art, tags, a trailing control and an expandabledetail.rowsandreorderare required. Areorderlist adds Move up and Move down to each expanded row, which fire amoveevent. An optionalsearch(1.0.10) puts a search box above the rows (Search).empty: a title, a line and one button.titleandtextare required.blocks: the blocks, one after another.
The template returns empty until the first item is imported:
if items.is_empty() {
return Ok(json!({
"subtitle": "No items",
"body": { "empty": {
"title": "No example items",
"text": format!("Drop a .{EXTENSION} file on the launcher, or import one."),
"action": pick
} }
}));
}Rows
{ "id": "okayama.exmod", "title": "Okayama", "subtitle": "41 kB",
"art": { "monogram": "O" },
"tags": [ { "text": "Track", "tone": "muted" } ],
"trailing": { "switch": { "id": "okayama.exmod", "on": true, "enabled": true } },
"detail": [ { "stats": [ { "label": "Size", "value": "41 kB" } ] } ],
"menu": [ { "id": "remove:okayama.exmod", "label": "Remove", "style": "danger",
"kind": { "confirm": { "title": "Remove Okayama?", "text": "It is deleted." } } } ] }id,titleandsubtitleare required.art,tags,trailing,detailandmenudefault to empty.artis"none",{ "monogram": "O" }or{ "image": "art/okayama.png" }.tagsare{ text, tone }badges.detailholds blocks, shown when the row is expanded.menu(1.0.0) opens on right-click. Each button is a menu item and acts as the button would: aconfirmbutton asks in a dialog first.
Trailing controls
{ "switch": { "id": "okayama.exmod", "on": true, "enabled": true } }
{ "choice": { "id": "livery", "options": ["Title sponsor", "Tier 1", "Replica"], "current": 0 } }
{ "button": { "id": "remove", "label": "Remove", "style": "danger" } }switch fires { "toggle": { "id", "on" } }
choice fires { "choose": { "id", "index" } }
button fires what the button's kind firesButtons
{ "id": "import", "label": "Import…", "icon": "upload", "style": "primary", "size": "large",
"kind": { "pick": { "title": "Import items", "extensions": ["exmod"], "folders": false, "multiple": true } } }idandlabelare required;iconis optional.styleisprimary,outline,ghostordanger(defaultoutline).size(1.3.0) isnormal(default) orlarge, for a page's main call to action.kindsays what a click does:
kind omitted (default) fires { "click": { "id" } }
{ "confirm": { "title", "text" } } asks in a dialog, then fires { "click": { "id" } }
{ "pick": { "title", "extensions", opens the file picker, then fires { "picked": { "id", "paths" } }
"folders", "multiple" } }Selection dialogs
When hello.capabilities contains "view.selection_dialog", a button may open a native selection dialog. Use it to choose recordings to delete, drivers to show, or what to export, without keeping those controls on the page. packages/addon-api/examples/selection_dialogs.rs demonstrates all three without deleting files.
{
"id": "drivers",
"label": "Drivers…",
"kind": { "selection": {
"title": "Drivers",
"text": "Choose the drivers to show in the charts.",
"multiple": true,
"allow_empty": true,
"selected": ["car-17"],
"apply": "Apply",
"options": [
{ "value": "car-17", "label": "Driver A", "group": "Team A" },
{ "value": "car-21", "label": "Driver B", "group": "Team A" },
{ "value": "car-3", "label": "Driver C", "group": "Team B", "help": "Car 3" }
]
} }
}titleandoptionsare required.textis an optional description or warning.- An option has a unique, non-empty
valueand a visiblelabel. Optionalgroupputs a heading above each consecutive group; keep teammates together in the option order. Optionalhelpappears below the label. selectedis the initial list of option values, default empty. Unknown or repeated values are invalid.multiple: truedraws checkboxes with Select all and Clear. The defaultfalsedraws single-choice radio buttons, such as Raw CSV data, Visuals and Both for an export.allow_emptydefaults tofalse: the primary action is disabled until there is a selection. Set it totruewhen no drivers is a valid filter. A single-choice dialog starts with at most one selected value.- A dialog has at most 256 options.
title,applyand each option'svalue,label,groupandhelpare at most 256 characters, andtextat most 2,000. A dialog over these limits doesn't open; the launcher shows the error instead. applylabels the primary button, default Apply. For deletion, use"style": "danger"on the outer button,"apply": "Delete selected", explanatory warning text and"allow_empty": false.- The option list scrolls within the dialog. Tab moves between controls, Space activates a focused choice or button, and Escape cancels. The dialog uses the launcher's native focus trap and appearance.
- Changes stay in the dialog. Cancel or Escape sends no event and discards the draft; a page refresh does not reset the choices. Opening it again uses the latest view's
selectedvalues. - Confirming closes the dialog and sends one
selectedevent, even when the initial selection was unchanged.valuescontains the chosen values in option order. There is no precedingclickevent and no event per checkbox change.
{ "selected": { "id": "drivers", "values": ["car-17", "car-21"] } }The addon handles the event through the existing effects, such as reload, notice or open. An event error uses the normal notification path; it does not reopen the dialog. Revalidate the selected IDs against current data before acting, especially before deletion. The launcher rejects confirmation after the source profile or addon instance has changed, or its section has been removed.
Check the capability before returning this button kind: an older launcher cannot deserialize it. Keep existing page controls as the fallback. Protocol API remains 1; this feature does not change existing forms, confirmation buttons or task lists.
Tones
tone colours tags, notices, text, pills, tiles, meters and cells: neutral (default), muted, accent, good, warn, bad.
{ "text": { "text": "The game is running: edits apply after it closes.", "tone": "warn" } }Icons
icon names one of a fixed set. A view with a name outside it is a result of the wrong shape, and the launcher marks the plugin failed (sent a bad result: unknown variant …).
activity arrow-right-left chevron-down chevron-up circle-alert circle-check copy eraser
folder-open gamepad layers lock map package pencil play plus puzzle settings
shield-check trash uploadLauncher 1.0.10 adds:
calendar car clock cloud-rain flag gauge history info refresh save search timer
trending-down trending-up triangle-alert trophy undo user users wallet wrench zap