MetricCard Composites
Pre-configured metric cards for common data patterns. Each composite exposes only the data props you need — no layout or design decisions required.
Show a basic metric value with optional trend
Show a value with sparkline trend over time
Compare values across categories with bar visualization
Compare two related values side by side
Show a value with directional indicator (up/down/flat)
Show percentage breakdown with a donut ring
Feature a single important metric prominently
Show completion toward a goal or target
Display segmented data with proportional visualization
API Reference
SimpleMetricCard
TrendShow a basic metric value with optional trend
import { SimpleMetricCard } from '@so.boss/gloss-ui';
<SimpleMetricCard
label="Active Users"
value={1284}
trend={{ value: 4.2, direction: 'up' }}
subtitle="Currently online"
/>TrendCard
TrendShow a value with sparkline trend over time
| Prop | Type | Default | Description |
|---|---|---|---|
trendData | number[] | Required | Sparkline data points for trend visualization |
accentColor | string | — | Accent color for sparkline |
import { TrendCard } from '@so.boss/gloss-ui';
<TrendCard
label="Daily Revenue"
value={125430}
format={{ prefix: '$', abbreviated: true }}
trendData={[42, 38, 51, 47, 55, 60, 58, 63, 71, 68]}
trend={{ value: 12.5, direction: 'up' }}
subtitle="MTD"
accentColor="#6366f1"
/>BarChartCard
DistributionCompare values across categories with bar visualization
| Prop | Type | Default | Description |
|---|---|---|---|
barData | number[] | Required | Bar chart data points |
accentColor | string | — | Accent color for bars |
import { BarChartCard } from '@so.boss/gloss-ui';
<BarChartCard
label="Orders by Channel"
value={2847}
barData={[18, 32, 25, 41, 35, 28, 22]}
trend={{ value: 8.3, direction: 'up' }}
subtitle="Last 7 days"
accentColor="#3b82f6"
/>ComparisonCard
ComparisonCompare two related values side by side
| Prop | Type | Default | Description |
|---|---|---|---|
comparison | { current, prior, currentLabel?, priorLabel? } | Required | Comparison data with current and prior period values |
import { ComparisonCard } from '@so.boss/gloss-ui';
<ComparisonCard
label="Revenue vs Target"
comparison={{
current: 125430,
prior: 112800,
currentLabel: 'This Month',
priorLabel: 'Last Month',
}}
format={{ prefix: '$', abbreviated: true }}
trend={{ value: 11.2, direction: 'up' }}
/>DirectionCard
DirectionShow a value with directional indicator (up/down/flat)
| Prop | Type | Default | Description |
|---|---|---|---|
direction | 'up' | 'down' | Required | Arrow pointing direction |
shape | 'chevron' | 'triple' | 'bars' | — | Arrow visual shape |
import { DirectionCard } from '@so.boss/gloss-ui';
<DirectionCard
label="Growth Rate"
value="18.4%"
direction="up"
shape="chevron"
trend={{ value: 3.1, direction: 'up' }}
subtitle="Quarter over quarter"
/>DistributionCard
DistributionShow percentage breakdown with a donut ring
| Prop | Type | Default | Description |
|---|---|---|---|
donutValue | number | Required | Current donut value |
donutMax | number | — | Maximum donut value (default 100) |
accentColor | string | — | Accent color for donut ring |
import { DistributionCard } from '@so.boss/gloss-ui';
<DistributionCard
label="Fill Rate"
value={78}
format={{ suffix: '%' }}
donutValue={78}
donutMax={100}
trend={{ value: 2.4, direction: 'up' }}
accentColor="#10b981"
/>HighlightCard
HighlightFeature a single important metric prominently
| Prop | Type | Default | Description |
|---|---|---|---|
highlightColor | string | Required | Semantic highlight color (hex or CSS variable) |
import { HighlightCard } from '@so.boss/gloss-ui';
<HighlightCard
label="Critical Alert"
value={3}
highlightColor="#ef4444"
trend={{ value: -1, direction: 'down', label: 'vs yesterday' }}
subtitle="Active incidents"
/>ProgressCard
ProgressShow completion toward a goal or target
| Prop | Type | Default | Description |
|---|---|---|---|
progressValue | number | Required | Current progress value |
progressMax | number | Required | Maximum progress value (100%) |
import { ProgressCard } from '@so.boss/gloss-ui';
<ProgressCard
label="Quarterly Goal"
value="$842K"
progressValue={842000}
progressMax={1000000}
trend={{ value: 5.6, direction: 'up' }}
subtitle="84.2% complete"
/>SegmentCard
SegmentDisplay segmented data with proportional visualization
| Prop | Type | Default | Description |
|---|---|---|---|
segments | Array<{ value, color, label? }> | Required | Segment data for segmented bar visualization |
import { SegmentCard } from '@so.boss/gloss-ui';
<SegmentCard
label="Revenue by Region"
value="$2.4M"
segments={[
{ value: 45, color: '#6366f1', label: 'North' },
{ value: 30, color: '#3b82f6', label: 'South' },
{ value: 15, color: '#10b981', label: 'East' },
{ value: 10, color: '#f59e0b', label: 'West' },
]}
trend={{ value: 7.8, direction: 'up' }}
/>Need more control? MetricCard primitive
Composites cover common use cases with minimal configuration. If your needs go beyond what a composite offers, drop down to the MetricCard primitive for full control over layout, zones, and visualization.