# FlowFuse `ui-template` Manual (EVOLV Reference) Source: https://dashboard.flowfuse.com/nodes/widgets/ui-template.html ## Purpose Custom Vue 3 / Vuetify / HTML widget. Full scripting, scoped CSS, send/receive messages. ## Scopes | Scope | Renders | Use Case | |-------|---------|----------| | Widget (Group) | Inside a ui-group | Custom gauges, tables, controls | | Widget (Page) | On page, outside groups | Floating overlays, full-width banners | | Widget (UI) | On every page | Global headers, footers | | CSS (All Pages) | N/A — injects ` ``` ## Built-in Variables | Variable | Description | |----------|-------------| | `id` | This node's unique ID | | `msg` | Latest received message (reactive) | | `$socket` | Socket.io client for custom events | ## Sending Messages ```js this.send({ payload: 42, topic: "my-topic" }); this.submit(); // sends FormData from
``` ## Receiving Messages **Option A** — Vue `watch`: ```js watch: { msg(newMsg) { /* react */ } } ``` **Option B** — Socket listener: ```js mounted() { this.$socket.on('msg-input:' + this.id, (msg) => { /* handle */ }); } ``` ## Teleports (inject into dashboard chrome) ```html Custom Button ``` Targets: `#app-bar-title`, `#app-bar-actions`. ## Vuetify Components All Vuetify 3 components are available without import: ``, ``, ``, ``, etc. ## Dynamic Properties (`msg.ui_update`) ```js msg.ui_update = { format: "

New template content

" }; ``` ## EVOLV Key Rules 1. Use templates sparingly — prefer built-in widgets when they fit. 2. For complex custom visualizations (SVG P&ID, animated schematics), template is the right choice. 3. Always use `