Skip to content

Metric, Metrics & MetricGroups ​

Three related components for displaying KPI-style numeric cards. Use ue-metric for a single value, ue-metrics for a grouped collection with an optional date-range filter, and ue-metric-groups for multiple ue-metrics groups laid out in a grid.


ue-metric ​

A single KPI card showing a large value and a label.

Props ​

PropTypeDefaultDescription
valueNumber|StringrequiredThe numeric or text value to display
labelStringrequiredDescriptive label shown below the value
colorStringnullColor applied to both value and label text
cardColorStringnullBackground color of the card
labelColorStringnullOverride label text color independently
valueClassString''Extra classes on the value element
labelClassString''Extra classes on the label element
denseBooleanfalseCompact mode — smaller text (text-h4 vs text-h3)
noInlineBooleanfalseRender as block instead of inline-block
centerBooleanfalseCenter-align the content
iconStringnullMDI icon shown before the label
appendIconStringnullMDI icon shown to the left of the value/label block
appendIconAttributesObject{}Attributes forwarded to the appendIcon v-icon

Slots ​

SlotScopeDescription
value{value, classes}Replaces the value element
label{label, classes, icon}Replaces the label element

Example ​

html
<ue-metric value="1,248" label="Total Orders" color="primary" />
<ue-metric value="98.5%" label="Uptime" color="success" dense />

ue-metrics ​

A card that renders a collection of ue-metric items in a flex row, with an optional title, subtitle, and date-range filter.

Props ​

PropTypeDefaultDescription
titleStringrequiredCard title
subtitleStringnullCaption below the title
itemsArray[]Array of metric objects — each is spread as props into ue-metric
colorStringnullText color for all metrics
cardColorStringnullCard background color
filterColorStringnullColor for the date-range filter area
bgHeaderColorStringnullHeader background color
noInlineBooleanfalseRender card as block
metricWidthString|NumbernullFixed width for each metric
minMetricWidthString|Number130Minimum width (px) for each metric
metricAttributesObject{}Extra attributes forwarded to every ue-metric
endpointStringnullAPI endpoint for date-range refresh. Required to activate the date filter
dateLabelString'Today'Label shown next to the date
dateStringnullDate string displayed alongside the filter

Item object shape ​

js
{
  value: '1,248',
  label: 'Orders',
  color: 'primary',         // optional, overrides group color
  connectorFilter: {        // optional, marks this metric as filterable
    name: 'date_range',
    args: {}
  }
}

Example ​

php
@php
  $metrics = [
    ['value' => $totalOrders,  'label' => 'Total Orders'],
    ['value' => $revenue,      'label' => 'Revenue', 'color' => 'success'],
    ['value' => $pendingCount, 'label' => 'Pending',  'color' => 'warning'],
  ];
@endphp

<ue-metrics
  title="Sales Overview"
  :items='@json($metrics)'
  endpoint="{{ route('metrics.refresh') }}"
/>

ue-metric-groups ​

Renders multiple ue-metrics groups in a responsive v-row / v-col grid.

Props ​

PropTypeDefaultDescription
titleString''Card title wrapping all groups
itemsArrayrequiredArray of ue-metrics prop objects (each can include a col key for responsive overrides)
defaultColObject{cols: 12}Default v-col binding applied to every group column
metricsBgHeaderColorStringnullOverride bgHeaderColor for all groups
metricsNoInlineBooleannullOverride noInline for all groups
metricColorStringnullOverride color for all individual metrics
metricCardColorStringnullOverride cardColor for all individual metrics
metricLabelColorStringnullOverride labelColor for all individual metrics

Example ​

php
@php
  $groups = [
    [
      'title' => 'Sales',
      'items' => [
        ['value' => '320', 'label' => 'Orders'],
        ['value' => '$14,200', 'label' => 'Revenue'],
      ],
      'col' => ['cols' => 12, 'md' => 6],
    ],
    [
      'title' => 'Support',
      'items' => [
        ['value' => '12', 'label' => 'Open Tickets'],
        ['value' => '98%', 'label' => 'Resolution Rate'],
      ],
      'col' => ['cols' => 12, 'md' => 6],
    ],
  ];
@endphp

<ue-metric-groups title="Dashboard" :items='@json($groups)' />