Skip to content

@maxhealth.tech/prefab / auto / autoMetrics

Function: autoMetrics()

ts
function autoMetrics(metrics, options?): ContainerComponent;

Defined in: auto/metrics.ts:52

Auto-generate a KPI dashboard grid.

Parameters

ParameterType
metricsAutoMetricDef[]
options?AutoMetricsOptions

Returns

ContainerComponent

Example

ts
autoMetrics([
  { label: 'Revenue', value: '$42K', delta: '+12%', trend: 'up', trendSentiment: 'positive', sparkline: [10, 25, 18, 30, 42] },
  { label: 'Users', value: '1,234', delta: '+5%', trend: 'up', trendSentiment: 'positive' },
  { label: 'Errors', value: '3', delta: '-80%', trend: 'down', trendSentiment: 'positive' },
], { title: 'Dashboard', columns: 3 })

Released under the MIT License.