Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read and how they find the site, so we can improve it (Google Analytics).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

HTML Card

  • Widget
  • v1.0.0
  • Sep 1, 2026
  • MIT license
  • v4.2+ | Built-in

Useful to inject custom HTML code. Designed to display static information only.

Widget Type
  • Static
Category
  • Cards & Info
Use Cases
  • Smart Building
  • Smart City
  • Industrial Automation

Who it’s for

Dashboard builders who need a piece of the board that no widget covers — a block of instructions for the shift crew, a legend explaining what the colors mean, a link panel to the runbook, a formatted note above a chart. The requirement is layout control rather than data: the content is known in advance and does not change with the telemetry.

What it does

The HTML Card renders markup you write, styled by CSS you write, and nothing else. Entering <div class='card'>Shift handover at 14:00</div> with a matching .card rule produces exactly that block, centered and styled as specified, with no data binding of any kind.

  • Full markup control — headings, lists, tables, links and images render as ordinary HTML inside the tile.
  • Styling is scoped to the card — the CSS box sits with the widget, so a class name used here does not collide with the rest of the dashboard.
  • The card is static by design, which means it never waits on a subscription, never shows a loading state and never goes stale.
  • Content is fixed at configuration time: the HTML Card interpolates no values, so a block that has to show a reading belongs on the HTML Value Card instead.

How to set up

Data keys

The HTML Card takes no datasource and no data keys — it is a static widget. The default configuration carries a leftover demo datasource, which can be removed without affecting what renders.

Content

SettingDefaultEffect
HTML<div class='card'>HTML code here</div>The markup rendered inside the tile
CSSA .card rule centering bold 32 px gray textStyles applied to that markup, scoped to this widget

How to customize

  • To change what the card says — edit the HTML box; anything valid inside a div renders, including lists, tables and links.
  • To restyle it — edit the CSS box. Give the outer element width: 100%; height: 100% so the content tracks the tile as the dashboard is resized.
  • To center content vertically — use flexbox in the CSS box, as the default rule does with display: flex; align-items: center.
  • To include a picture without an external request — embed it as a data: URI in the markup, which keeps the card working on air-gapped installations.

Tips

  • Write the outer element to fill the tile rather than to a fixed pixel size. A card built at fixed dimensions looks right at the size it was authored and wrong at every other breakpoint, and dashboards are routinely opened on phones.
  • Keep class names specific, like .handover-note rather than .card. Several HTML cards on one dashboard each carry their own CSS, and generic names make the boxes hard to tell apart when the dashboard is edited months later.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.