DataPoint
A component to display key metrics, values, and statistical trends.
Basic Usage
Total Users
24,531
Total registered users as of this month.
astro
---
import DataPoint from '@/components/data-display/DataPoint.astro';
---
<DataPoint
label="Total Users"
value="24,531"
description="Total registered users as of this month."
/> With Trends
Use the `trend` (`up`, `down`, `neutral`) and `trendValue` props to show performance changes over time.
Revenue
+20.1%
$45,231.89
From previous month
Active Subscriptions
-4.5%
1,245
From previous month
Support Tickets
0.0%
312
From previous month
astro
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<DataPoint
label="Revenue"
value="$45,231.89"
trend="up"
trendValue="+20.1%"
description="From previous month"
/>
<DataPoint
label="Active Subscriptions"
value="1,245"
trend="down"
trendValue="-4.5%"
description="From previous month"
/>
<DataPoint
label="Support Tickets"
value="312"
trend="neutral"
trendValue="0.0%"
description="From previous month"
/>
</div> API Reference
| Property | Description | Type | Default |
|---|---|---|---|
| value | The primary metric or value to display. | string | - |
| label | The label or title of the metric. | string | - |
| description | Additional descriptive text below the value. | string | - |
| trend | The trend direction, which determines the icon and color. | 'up' | 'down' | 'neutral' | - |
| trendValue | The value representing the trend (e.g., "+20%"). | string | - |