Phara UI v2.x

Stats Card

A metric card for dashboards displaying analytics, financial data, or KPIs — with optional trend indicators, icons, and loading states.

Basic

Provide title, value, change, and an optional icon to render a metric card.

Total Revenue

$48,295

+12.5% vs last month
Blade
<x-ui::stats-card
    title="Total Revenue"
    value="$48,295"
    change="+12.5%"
    change-label="vs last month"
    icon="banknotes"
    icon-color="green"
/>
Trend

The trend indicator is auto-detected from the change prefix: + → green up, - → red down, anything else → neutral. Override with the trend prop.

Revenue

$48,295

+12.5% vs last month

Churn Rate

3.2%

-0.4% vs last week

Uptime

99.98%

0.00% no change
Blade
{{-- Trend is auto-detected from the change string prefix --}}

{{-- + prefix → up (green) --}}
<x-ui::stats-card title="Revenue" value="$48,295" change="+12.5%" change-label="vs last month" />

{{-- - prefix → down (red) --}}
<x-ui::stats-card title="Churn Rate" value="3.2%" change="-0.4%" change-label="vs last week" />

{{-- neutral (no +/- prefix) --}}
<x-ui::stats-card title="Uptime" value="99.98%" change="0.00%" change-label="no change" />

{{-- Override explicitly --}}
<x-ui::stats-card title="Sessions" value="12,430" change="821" change-label="new today" trend="up" />
Variants

Three visual styles: default (shadow), outline (border only), and flat (muted background).

Default

$48,295

+12.5%

Outline

$48,295

+12.5%

Flat

$48,295

+12.5%
Blade
{{-- Default: white bg + subtle shadow --}}
<x-ui::stats-card title="Revenue" value="$48,295" variant="default" />

{{-- Outline: white bg + visible border --}}
<x-ui::stats-card title="Revenue" value="$48,295" variant="outline" />

{{-- Flat: gray bg, no border --}}
<x-ui::stats-card title="Revenue" value="$48,295" variant="flat" />
Icon Colors

Use icon-color to match the icon badge to your metric's meaning. Accepts: blue green yellow red purple sky pink zinc.

Revenue

$48,295

Users

8,421

Orders

1,204

Alerts

3

Pending

27

Uptime

99.98%

Blade
<x-ui::stats-card title="Revenue"   value="$48,295" icon="banknotes"          icon-color="green"  />
<x-ui::stats-card title="Users"     value="8,421"   icon="users"               icon-color="blue"   />
<x-ui::stats-card title="Orders"    value="1,204"   icon="shopping-cart"       icon-color="purple" />
<x-ui::stats-card title="Alerts"    value="3"       icon="bell-alert"          icon-color="red"    />
<x-ui::stats-card title="Pending"   value="27"      icon="clock"               icon-color="yellow" />
<x-ui::stats-card title="Uptime"    value="99.98%"  icon="signal"              icon-color="sky"    />
Description

Add a description for context or secondary detail below the trend badge.

Active Users

8,421

+324 new today

23% above the 30-day average of 6,842 users.

Blade
<x-ui::stats-card
    title="Active Users"
    value="8,421"
    change="+324"
    change-label="new today"
    description="23% above the 30-day average of 6,842 users."
    icon="users"
    icon-color="blue"
/>
Loading

Set :loading="true" to show a skeleton while data is being fetched. Useful with Livewire's wire:loading pattern.

Blade
<x-ui::stats-card
    title="Total Revenue"
    value=""
    :loading="true"
    icon="banknotes"
/>
Custom Slot

Pass any content into the slot to render below the metric — useful for inline sparklines, progress bars, or mini-charts.

Storage Used

68.4 GB

CPU Load

42%

+8% vs 1h ago
Blade
<x-ui::stats-card
    title="Storage Used"
    value="68.4 GB"
    change-label="of 100 GB"
>
    <x-ui::progress :value="68" size="sm" color="blue" />
</x-ui::stats-card>
Dashboard Grid

Compose multiple cards in a responsive grid for a typical analytics dashboard header.

Total Revenue

$48,295

+12.5% vs last month

Active Users

8,421

+324 new today

New Orders

1,204

+8.2% vs last week

Churn Rate

3.2%

-0.4% vs last month
Blade
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4">
    <x-ui::stats-card
        title="Total Revenue"
        value="$48,295"
        change="+12.5%"
        change-label="vs last month"
        icon="banknotes"
        icon-color="green"
    />
    <x-ui::stats-card
        title="Active Users"
        value="8,421"
        change="+324"
        change-label="new today"
        icon="users"
        icon-color="blue"
    />
    <x-ui::stats-card
        title="New Orders"
        value="1,204"
        change="+8.2%"
        change-label="vs last week"
        icon="shopping-cart"
        icon-color="purple"
    />
    <x-ui::stats-card
        title="Churn Rate"
        value="3.2%"
        change="-0.4%"
        change-label="vs last month"
        icon="arrow-trending-down"
        icon-color="red"
    />
</div>