MDK Logo

Card

Card containers and card-based layouts

Card components for grouping and presenting content.

Prerequisites

  • Complete the installation

  • Add the dependency to your app's package.json
{
  "dependencies": {
    "@tetherto/mdk-react-devkit": "*",
    "@tetherto/mdk-react-adapter": "*",
    "@tetherto/mdk-ui-foundation": "*"
  }
}

Run npm install from the mdk/ui workspace root after your app is under apps/ so npm links workspace packages.

  • 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.

ActiveIncidentsCard

Summary card displaying a list of active incidents/alerts with severity indicators, loading skeleton, and empty state. Rows are virtualized via @tanstack/react-virtual so the card stays responsive with thousands of incidents

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/active-incidents-card/index.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Additional class names appended to the root
emptyMessageOptionalstring-Message rendered when no items
isLoadingOptionalbooleanfalseShow skeleton rows instead of items
itemsOptionalTIncidentRowProps[][]Incident rows to render
labelOptionalstring"Active Alerts"Header label shown above the list
onItemClickOptional(id: string) => void-Called with the incident id when a row is clicked
skeletonRowsOptionalnumber4Number of skeleton rows shown when isLoading

CabinetDetailCard

Read-only LV cabinet detail: powermeter readings, the root plus per-position temperature readings (severity-coloured, with an offline marker), and the active-warnings timeline. Presentational — shape the rows with useCabinetDetail

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/explorer/details-view/cabinet-detail-card/cabinet-detail-card.tsx

Props

PropStatusType / OptionsDefaultDescription
alarmsDataItemsRequiredTimelineItemData[]-Active-warnings timeline items
powerMetersRequiredCabinetReadingRow[]-Non-root powermeter reading rows
tempSensorsRequiredCabinetReadingRow[]-Non-root temperature sensor reading rows
titleRequiredstring-Cabinet display title (LV Cabinet 1 / transformer title)
isLoadingOptionalboolean-Shows a spinner while the cabinet snapshot is loading
onNavigateOptional((path: string) => void)-Router navigate used by warning rows to deep-link into the alert
rootTempSensorOptionalCabinetReadingRow-The cabinet-root temperature reading, when present

MetricCard

Compact card displaying a labelled metric value with optional highlight and transparency states

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/metric-card/index.tsx

Props

PropStatusType / OptionsDefaultDescription
labelRequiredstring-Text label shown above the value
unitRequiredstring-Unit suffix appended after the value (e.g. "TH/s", "W", "USD")
valueRequiredstring | number | null-Metric value to display
bgColorOptionalstringBLACK_ALPHA_05Custom background color (CSS color string)
classNameOptionalstring-Additional class names appended to the root element
isHighlightedOptionalbooleanfalseRenders the value in orange to draw attention
isTransparentColorOptionalbooleanfalseRenders the value in a low-opacity white for de-emphasized display
isValueMediumOptionalbooleanfalseApplies a medium-weight variant to the value typography
noMinWidthOptionalbooleanfalseRemoves the default minimum width so the card shrinks to content
showDashForZeroOptionalbooleanfalseDisplays — instead of 0 when value is zero

MiningPoolsPanel

Dashboard card that lists configured mining pools — one row per pool, with revenue, hash rate, and an optional "Show details" action.

Pure presentation: the row data + click handler come from props, shaped upstream by usePoolRows (or any caller producing MiningPoolRows)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/mining-pools-panel/index.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Extra className for the root
emptyMessageOptionalstring"No pools configured"Message shown when rows is empty
hideHeaderOptionalbooleanfalseHide the title row entirely
isLoadingOptionalbooleanfalseLoading state — renders skeleton rows
labelOptionalstring"Mining Pools"Override the card title — defaults to Mining Pools
onShowDetailsOptional(row: MiningPoolRow) => void-Called when the user clicks the per-row "Show details" button
rowsOptionalMiningPoolRow[][]Pool rows, in display order
skeletonRowsOptionalnumber3Number of skeleton rows to show while loading

PoolDetailsCard

Compact key/value card for displaying pool metadata (URL, fee, worker count, etc.). Empty list renders a "No data available" placeholder

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/pool-details-card/index.tsx

Props

PropStatusType / OptionsDefaultDescription
detailsRequiredPoolDetailItem[]-Detail rows to render
classNameOptionalstring-Additional class names
labelOptionalstring-Header label
underlineOptionalbooleanfalseRender an underline under the label

PoolDetailsPopover

Button-triggered popover that displays a pool's key/value details (URL, fee, worker count, status, …) inside a Radix Dialog. Wraps PoolDetailsCard so the read-out matches the embedded card variant

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/pool-details-popover/index.tsx

Props

PropStatusType / OptionsDefaultDescription
detailsRequiredPoolDetailItem[]-Detail rows
classNameOptionalstring-Additional class names
descriptionOptionalstring-Dialog body description
disabledOptionalbooleanfalseDisable the trigger
titleOptionalstring-Dialog title
triggerLabelOptionalstring-Trigger button label

On this page