MDK Logo
UI Kitreact-devkitComponentsCoreCharts

MinMaxAvg

Min / Max / Avg summary row with consistent MDK label and value styling.

Min / Max / Avg summary row with consistent MDK label and value styling.

import { MinMaxAvg } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
minRequiredstring | undefined
maxRequiredstring | undefined
avgRequiredstring | undefined
classNameOptionalstring | undefined

Usage

Displays Min, Max, and Avg labels with MDK chart footer styling (orange labels, grey values).

Usage

import { MinMaxAvg } from "@tetherto/mdk-react-devkit/core"

<MinMaxAvg min="10 TH/s" max="100 TH/s" avg="55 TH/s" />

Use with ChartContainer via the minMaxAvg prop (pre-formatted strings) or the footer slot.

With numeric data, pair computeStats and formatMinMaxAvg from chart utils:

import { computeStats, formatMinMaxAvg } from "@tetherto/mdk-react-devkit/core"

const stats = computeStats(values)
const minMaxAvg = formatMinMaxAvg(stats, (v, key) =>
  key === "avg" ? `${v.toFixed(1)} TH/s` : `${v} TH/s`,
)

Example

/** * Runnable example for MinMaxAvg. */import { MinMaxAvg } from './index'export const MinMaxAvgExample = () => (  <MinMaxAvg min="65 TH/s" max="80 TH/s" avg="72.6 TH/s" />)