For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

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.

Custom Metric is the new version of the HTML Canvas widget. Use it for new custom widgets.

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.

Last updated

Was this helpful?