Custom Metric
Build custom dashboard widgets as React apps with the Custom Metric widget and @ubidots/react-html-canvas
Introduction
The Custom Metric widget lets you build your own dashboard widget when the off-the-shelf widgets don't fit. A Custom Metric widget is a small React app built on @ubidots/react-html-canvas. It renders inside an iframe on the dashboard and talks to the dashboard only through that library: hooks, actions and widget events.
How to create a Custom Metric widget
Go to a dashboard, click the Add new widget button (+) and select Custom Metric. Pick the variables the widget shows, then write the widget's code in its code editor, or describe what you want to the AI assistant and let it write the code.
What a widget can do
A widget works with the dashboard in two directions: what it can GET (read) and what it can EMIT (drive). See Dashboard capabilities for the full list, with the exact shape and a snippet for each item.
Project setup: the files of a widget, how it mounts, and its
manifest.toml.Layout and CSS: fill the widget at any size.
Dashboard capabilities: the widget's data, devices, date range, real-time, dashboard actions and widget-to-widget events.
Last updated
Was this helpful?