WidgetKit

App

Dashboard widget kit (next-boilerplate dashboard phase 21). WidgetCard frames every widget (title row with icon, subtitle and help, card buttons for full screen, CSV and refresh, loading/empty/unconfigured/error/stale/unavailable states, "Updated" footer; `unavailable` keeps the title and shows an UnavailableContribution). Versioned settings templates (core:card, core:format, core:board and one per widget type) give ThingsBoard-depth editing with free colours (any CSS colour or a theme token); stored settings carry $v and migrate with append-only steps. WidgetSettingsEditor edits a placement in tabs with Basic/Advanced, layout variants picked from thumbnail cards (renderWidgetPreview, or a host renderPreview); WidgetBoard lays out a whole board with edit mode and JSON export/import that carries every card.

WidgetCard

Preview

Raised (default)

Hall A

Body

Updated 3 minutes ago

Free colours

Hall A

Any CSS colour or a theme token

Old data

Old data

Hall A

Badge on stale data

Code
<WidgetCard title="Load" card={card} stale={stale}>{body}</WidgetCard>

WidgetCard unavailable (admin view of a widget whose module is off)

Preview

Open calls

Disabled

The module that provides this is turned off.

Revenue forecast

Not in plan

Your current plan does not include this.

Device map

Quarantined

Paused automatically after repeated errors.

Code
<WidgetCard title="Open calls" card={card} state="unavailable"
  unavailable={{ reason: 'disabled', action: { label: 'Enable telephony', onClick: enable } }} />

PlacementCard + WidgetSettingsEditor

Preview

Occupancy

Rooms booked
86%+8.9 %
Layout
Value
Label
Icon
Colour ranges
Item 1

The first range the value falls in colours it. Leave an end empty for open-ended.

Comparison
Value format
Code
<WidgetSettingsEditor templates={[kind.template, CORE_CARD, CORE_FORMAT]} settings={settings} onChange={setSettings} caps={caps} />

WidgetBoard (edit, export, import)

Preview

Demo board

Temperature

21.4°C

Load

72%
0100

Target

640of 1,000
Code
<WidgetBoard doc={doc} onChange={setDoc} data={data} kinds={BUILTIN_KINDS} views={BUILTIN_VIEWS} />
Sourcemodules/app/WidgetKit/index.ts