MDK Logo

Widget

Dashboard widgets and data display cards

Widget components for dashboards and data displays.

Prerequisites

  • Install the packages
npm install \
  @tetherto/mdk-react-devkit \
  @tetherto/mdk-react-adapter \
  @tetherto/mdk-ui-foundation

Install zod@^4.6.6 first. @tetherto/mdk-react-devkit@0.12.1 declares zod@^4.6.6 as a peer while its @hookform/resolvers peer pulls a chain that pins zod 3, so the command above aborts with ERESOLVE in a project that has no zod. Installing zod 4 at the project root resolves it:

npm install zod@^4.6.6
  • Import styles: import '@tetherto/mdk-react-devkit/styles.css'

Components

@tetherto/mdk-react-devkit

Import the public APIs on this page from @tetherto/mdk-react-devkit.

EnabledDisableToggle

Switch with confirmation that enables or disables a container, miner, or feature flag

agent-ready

Source

src/domain/components/enabled-disable-toggle/USAGE.md

src/domain/components/enabled-disable-toggle/enabled-disable-toggle.tsx

Props

PropStatusType / OptionsDefaultDescription
isButtonDisabledRequiredboolean-Disables the Enable/Disable buttons when a command is in-flight
isOfflineRequiredboolean-Disables all controls and shows an offline tooltip
onToggleRequired(params: EnabledDisableToggleCbParams) => void-Callback fired when the user confirms a state change
tankNumberRequiredstring | number-Tank identifier used in the label (Tank {N} Circulation). Pass an empty string for the air exhaust label
valueRequiredunknown-Current state. A boolean drives a switch display; non-boolean shows action buttons

GenericDataBox

Reusable labelled stat box used by container summary panels for one-off numeric values.

Displays a table of label-value-unit rows

agent-ready

Source

src/domain/components/data-box/generic-data-box/USAGE.md

src/domain/components/data-box/generic-data-box/generic-data-box.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalDataItem[][]Array of data items to display
fallbackValueOptionalunknown-Fallback value when value is undefined

MinerMetricCard

Single-metric card (hashrate, temperature, or power) for one miner with sparkline and delta.

Displays key metrics for a miner including: - Efficiency (fixed position top-right) - Hash rate, Temperature - Frequency, Consumption - Optional secondary stats in grid

agent-ready

Source

src/domain/components/stat-cards/miner-metric-card/USAGE.md

src/domain/components/stat-cards/miner-metric-card/miner-metric-card.tsx

Props

PropStatusType / OptionsDefaultDescription
primaryStatsOptionalStatItem[]-Primary statistics (efficiency, hashrate, temperature, frequency, consumption)
secondaryStatsOptionalStatItem[]-Secondary statistics to display in grid
showSecondaryStatsOptionalbooleantrueWhether to show secondary stats section
StatItem
PropStatusType / OptionsDefaultDescription
nameOptionalstring-In primaryStats, selects the slot and must be exactly 'Efficiency', 'Hash rate', 'Temperature', 'Frequency' or 'Consumption'; in secondaryStats, the label (and React key)
unitOptionalstring-Unit appended after the value in primaryStats; ignored in secondaryStats, so fold it into value there
valueOptionalstring | number-Displayed value; Efficiency only shows when it is a number

MinersActivityChart

Per-status miner counts (online / offline / faulted / power-mode). Renders as coloured indicator dots (indicators) or tinted status tiles (tiles)

agent-ready

Source

src/domain/components/miners-activity-chart/USAGE.md

src/domain/components/miners-activity-chart/miners-activity-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalMinersActivityData{}Time-series data for online/offline/faulted counts
errorOptionalMinerActivityChartErrorProp | nullnullError details to display
isDemoModeOptionalbooleanfalseUse demo/mock data
isErrorOptionalbooleanfalseShow error state
isLoadingOptionalbooleanfalseShow loading state
largeOptionalbooleanfalseUse tall variant
showLabelOptionalbooleantrueShow axis labels
variantOptional"indicators" | "tiles""indicators"indicators (default) renders coloured dots; tiles renders tinted status tiles
MinersActivityData
PropStatusType / OptionsDefaultDescription
totalOptionalnumber-Total miner count; not rendered, since each tile reads its own status key (e.g. offline, error, sleep) and shows 0 when absent
MinerActivityChartErrorProp
PropStatusType / OptionsDefaultDescription
dataOptional{ message?: string }-Error payload; message becomes the error alert description when isError is set, else a generic retry hint

SingleStatCard

Hero stat tile rendering one big number with a label and optional delta indicator.

Displays a single statistic with optional animations and variants

agent-ready

Source

src/domain/components/stat-cards/single-stat-card/USAGE.md

src/domain/components/stat-cards/single-stat-card/single-stat-card.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Additional class for the root element
colorOptionalstring"inherit"Color for flash/border
flashOptionalbooleanfalseEnable flash animation
nameOptionalstring-Stat name/label
rowOptionalbooleanfalseRow layout
subtitleOptionalstring""Subtitle text
superflashOptionalbooleanfalseEnable superflash animation (faster)
unitOptionalstring""Unit of measurement
valueOptionalstring | number | nullnullStat value
variantOptional"primary" | "secondary" | "tertiary" | "highlighted" | "compact""primary"Card variant. compact is a centred name-over-value tile in muted text, for dense grids of secondary metrics

WidgetTopRow

Compact header row used at the top of container / miner widgets — shows the title, one badge per alarm category you pass, and the current power reading (or an error tooltip)

agent-ready

Source

src/domain/components/widget-top-row/USAGE.md

src/domain/components/widget-top-row/index.tsx

Props

PropStatusType / OptionsDefaultDescription
titleRequiredstring-Widget title
alarmsOptionalWidgetAlarmGroup[]-Alarm category badges, in display order. Categories with no items render nothing
classNameOptionalstring-Additional class names
powerOptionalnumber-Power reading; rendered in kilo-units
statsErrorMessageOptionalstring | ErrorWithTimestamp[] | null-Error tooltip content; replaces power
unitOptionalstring-Power unit (e.g. "kW")
WidgetAlarmGroup
PropStatusType / OptionsDefaultDescription
iconRequiredReact.ReactNode-Badge icon
titleRequiredstring-Category label; the tooltip heading reads <title> issues
itemsOptionalAlertRecord[]-Active alerts in this category; the badge is hidden when empty

On this page