Documentation Index
Fetch the complete documentation index at: https://araf.badr.co.id/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Metric Cards are used to display key quantitative data on dashboards. Each card shows one primary metric, equipped with a trend indicator (positive/negative), and an optional action button to view a detailed report.Views 24 hours⋮
2,000
↑ 100
↗
⋮Views 24 hours
2,000
↑ 100
↗
Views 24 hours2,000
↗ 100%vs last month
Views 24 hours⋮
2,000
↗ 100%vs last month
Installation
Usage
Type Variants
Metric Cards have 4 types that determine how the metric is visualized.- Simple
- Icon 01
- Icon 02
- Chart
The most compact type — displays only the label, metric number, and a trend badge aligned to the bottom-right of the number. Ideal for simple metrics without additional visual context.
Views 24 hours⋮
2,000
↑ 100
Bounce Rate⋮
4,120
↓ 40
Actions
Theactions prop adds a “View report” button at the bottom of the card, which can be used to navigate to a detailed report page.
actions=false (default)
Views 24 hours⋮
2,000
↑ 100
actions=true
Trend Indicator
Every Metric Card displays a trend indicator to show the change compared to the previous period.Badge (Simple & Icon 01)
↑ 100 Positive↓ 40 Negative
| State | Background | Text | Icon |
|---|---|---|---|
| Positive | #ECFDF3 (Success/50) | #027A48 (Success/700) | arrow-up |
| Negative | #FEF3F2 (Error/50) | #B42318 (Error/700) | arrow-down |
Change Text (Icon 02 & Chart)
↗ 100% vs last month↘ 12% vs last month
| State | Color | Icon |
|---|---|---|
| Positive | #16A34A (Green/07) | arrow-up-right |
| Negative | #B42318 (Error/700) | arrow-down-right |
Breakpoints
- Desktop
- Mobile
Card width is 388px, with 24px padding on all sides.
| Property | Value |
|---|---|
| Width | 388px |
| Padding | 24px |
| Metric number | 36px Inter SemiBold |
| Label | 14–16px Inter Medium |
| Chart | 128×64px |
| Featured icon | 48×48px |
Design Tokens
Card
| Token | Value |
|---|---|
| Background | #FFFFFF |
| Border radius | 8px |
| Padding | 24px |
| Shadow | 0px 1px 3px rgba(16,24,40,0.1) + 0px 1px 2px rgba(16,24,40,0.06) |
Typography
| Element | Font | Size | Weight | Color |
|---|---|---|---|---|
| Label (Simple/Icon 01) | Inter | 14px | 500 | #71717A |
| Label (Icon 02/Chart) | Inter | 16px | 500 | #011829 |
| Metric number | Inter | 36px | 600 | #011829 |
| Change text | Inter | 14px | 500 | #16A34A / #B42318 |
| Context label | Inter | 14px | 500 | #71717A |
Featured Icon (Icon 01)
| Trend | Background | Border |
|---|---|---|
| Positive | #22C55E | 8px solid #16A34A |
| Negative | Color matching the metric type | 8px solid border (darker shade) |
Featured Icon (Icon 02)
| Trend | Background | Border | Icon color |
|---|---|---|---|
| Positive | #DBEAFE | 8px solid #EFF6FF | #1D4ED8 |
| Negative | #FEE2E2 | 8px solid #FFF1F2 | #DC2626 |
API Reference
MetricCard
The display type of the metric card.
The metric label text, displayed above the number.
The primary metric value displayed large (e.g.
"2,000", "89%").The direction of the metric change — determines the color and icon of the trend indicator.
The numeric change value (e.g.
100 → displayed as ↑ 100 or 100%).The descriptive text for the change. Only shown on
icon-02 and chart types.The icon displayed in the featured icon area. Required for
icon-01 and icon-02 types.Data array for the sparkline chart. Required for the
chart type.If
true, displays a “View report” button at the bottom of the card (Desktop only).Callback fired when the “View report” button is clicked. Required when
actions is true.The rendering breakpoint of the card. Mobile does not support the
actions prop.Additional class name for custom styling.
Accessibility
- Use a descriptive
aria-labelon the card for screen readers, e.g.aria-label="Views 24 hours: 2,000, up 100 from the previous period" - Trend icons should include
aria-hidden="true"since they are already represented by the change text - The “View report” button must have clear text or an
aria-labelif it only shows an icon - Ensure the trend badge color contrast meets WCAG AA (green
#027A48on#ECFDF3✓) - The sparkline chart should include
role="img"and anaria-labeldescribing the trend
Do’s & Don’ts
Do
- Use one metric per card
- Ensure
changeLabelprovides clear context (e.g. “vs last week”) - Choose the
charttype for metrics with significant fluctuations that need to be visualized - Arrange cards in a 3–4 column grid on desktop
- Use the
icon-01type for metrics with a clear visual category (sales, traffic, etc.)
Don't
- Don’t display more than one large number per card
- Don’t use the
charttype for static data (with no change over time) - Don’t let
valueget too long — truncate if needed (e.g.2.3Mnot2,312,400) - Don’t hide the trend indicator — always provide change context
- Don’t use
actions=truewithout a workingonViewReporthandler