Skip to content

@agala-labs/ui

Stat

Presents one key metric with optional supporting context, trend, and icon.

Examples

Vertical cards support side-by-side comparison of a small set of decision-relevant metrics.

Dashboard cards
Monthly revenue$24,800
+12.4% vs last month
Active members1,284
Across 18 teams
-2.1% vs last month
<AgalaStat label="Monthly revenue" value="$24,800" :trend="12.4" trend-label="vs last month" icon="trending-up" />
<AgalaStat label="Active members" value="1,284" secondary-value="Across 18 teams" :trend="-2.1" trend-label="vs last month" icon="users" />

Import

import { AgalaStat } from '@agala-labs/ui'

API

PropTypeDefaultDescription
labelstring—Required metric label.
valuestring | number—Required metric value.
secondaryValuestring | number—Neutral supporting value rendered before any trend.
trendnumber—Signed trend value.
trendLabelstring—Trend context.
iconstring—Agala icon name.
iconBg'primary' | 'danger' | 'success' | 'warning' | 'info'—Icon surface.
layout'vertical' | 'row' | 'inline''vertical'Vertical cards, icon-led rows, or intrinsic inline summaries.
valueFirstbooleanfalsePlaces the metric value before its label without changing semantic content.
borderedbooleantrueAdds the quiet grouped surface.
labelTransformstring—CSS text transform override.

Accessibility

Trend direction is conveyed by signed text and labels as well as color/icon.

Released under the MIT License.