> ## 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.

# Metric Cards

> Summary metric cards for dashboards — available in 4 display types and 2 trend states.

## 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.

<div style={{display:"flex",flexWrap:"wrap",gap:"16px",padding:"24px",background:"#F8F9FA",borderRadius:"12px"}}>
  <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"240px",display:"flex",flexDirection:"column",gap:"8px"}}>
    <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
      <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif",lineHeight:"20px"}}>Views 24 hours</span>
      <span style={{color:"#A1A1AA",fontSize:"18px",lineHeight:"1",cursor:"pointer"}}>⋮</span>
    </div>

    <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
      <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

      <div style={{paddingBottom:"8px"}}>
        <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,fontFamily:"Inter,sans-serif",padding:"2px 8px 2px 10px",borderRadius:"16px",display:"inline-flex",alignItems:"center",gap:"4px"}}>↑ 100</span>
      </div>
    </div>
  </div>

  <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"240px",display:"flex",flexDirection:"column",gap:"24px"}}>
    <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
      <div style={{width:"48px",height:"48px",borderRadius:"28px",background:"#22C55E",border:"8px solid #16A34A",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
        <span style={{color:"#fff",fontSize:"18px"}}>↗</span>
      </div>

      <span style={{color:"#A1A1AA",fontSize:"18px",lineHeight:"1",cursor:"pointer"}}>⋮</span>
    </div>

    <div style={{display:"flex",flexDirection:"column",gap:"8px"}}>
      <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>

      <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
        <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

        <div style={{paddingBottom:"8px"}}>
          <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"Inter,sans-serif"}}>↑ 100</span>
        </div>
      </div>
    </div>
  </div>

  <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"240px",display:"flex",flexDirection:"column",gap:"24px"}}>
    <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
      <div style={{display:"flex",gap:"16px",alignItems:"center"}}>
        <div style={{width:"48px",height:"48px",borderRadius:"28px",background:"#DBEAFE",border:"8px solid #EFF6FF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
          <span style={{color:"#1D4ED8",fontSize:"16px"}}>↗</span>
        </div>

        <span style={{fontSize:"15px",fontWeight:500,color:"#011829",fontFamily:"Inter,sans-serif",lineHeight:"24px"}}>Views 24 hours</span>
      </div>

      <span style={{color:"#A1A1AA",fontSize:"18px",lineHeight:"1",cursor:"pointer"}}>⋮</span>
    </div>

    <div style={{display:"flex",flexDirection:"column",gap:"16px"}}>
      <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

      <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
        <span style={{color:"#16A34A",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif",display:"flex",alignItems:"center",gap:"4px"}}>↗ 100%</span>
        <span style={{fontSize:"13px",color:"#71717A",fontFamily:"Inter,sans-serif"}}>vs last month</span>
      </div>
    </div>
  </div>

  <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"240px",display:"flex",flexDirection:"column",gap:"24px"}}>
    <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
      <span style={{fontSize:"15px",fontWeight:500,color:"#011829",fontFamily:"Inter,sans-serif",lineHeight:"24px"}}>Views 24 hours</span>
      <span style={{color:"#A1A1AA",fontSize:"18px",lineHeight:"1",cursor:"pointer"}}>⋮</span>
    </div>

    <div style={{display:"flex",gap:"16px",alignItems:"flex-end"}}>
      <div style={{display:"flex",flexDirection:"column",gap:"16px",flex:1}}>
        <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

        <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
          <span style={{color:"#16A34A",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif"}}>↗ 100%</span>
          <span style={{fontSize:"13px",color:"#71717A",fontFamily:"Inter,sans-serif"}}>vs last month</span>
        </div>
      </div>

      {/* Mini sparkline SVG */}

      <svg width="80" height="48" viewBox="0 0 80 48" fill="none" style={{flexShrink:0}}>
        <path d="M0 40 C10 38, 20 32, 30 28 C40 24, 50 20, 60 12 C65 8, 72 4, 80 2" stroke="#22C55E" strokeWidth="2" fill="none" strokeLinecap="round" />

        <path d="M0 40 C10 38, 20 32, 30 28 C40 24, 50 20, 60 12 C65 8, 72 4, 80 2 L80 48 L0 48 Z" fill="#F0FDF4" />
      </svg>
    </div>
  </div>
</div>

## Installation

<CodeGroup>
  ```bash npm theme={null}
  npm install @araf-ds/core
  ```

  ```bash yarn theme={null}
  yarn add @araf-ds/core
  ```

  ```bash pnpm theme={null}
  pnpm add @araf-ds/core
  ```
</CodeGroup>

## Usage

```jsx theme={null}
import { MetricCard } from "@araf-ds/core";

export default function Dashboard() {
  return (
    <MetricCard
      type="chart"
      label="Views 24 hours"
      value="2,000"
      trend="positive"
      change={100}
      changeLabel="vs last month"
      actions
      onViewReport={() => router.push("/reports/views")}
    />
  );
}
```

## Type Variants

Metric Cards have **4 types** that determine how the metric is visualized.

<Tabs>
  <Tab title="Simple">
    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.

    <div style={{display:"flex",gap:"16px",flexWrap:"wrap",margin:"12px 0"}}>
      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"260px",display:"flex",flexDirection:"column",gap:"8px"}}>
        <div style={{display:"flex",justifyContent:"space-between"}}>
          <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>
          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
          <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

          <div style={{paddingBottom:"8px"}}>
            <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"Inter,sans-serif"}}>↑ 100</span>
          </div>
        </div>
      </div>

      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"260px",display:"flex",flexDirection:"column",gap:"8px"}}>
        <div style={{display:"flex",justifyContent:"space-between"}}>
          <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Bounce Rate</span>
          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
          <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>4,120</span>

          <div style={{paddingBottom:"8px"}}>
            <span style={{background:"#FEF3F2",color:"#B42318",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"Inter,sans-serif"}}>↓ 40</span>
          </div>
        </div>
      </div>
    </div>

    ```jsx theme={null}
    <MetricCard
      type="simple"
      label="Views 24 hours"
      value="2,000"
      trend="positive"
      change={100}
    />
    ```
  </Tab>

  <Tab title="Icon 01">
    Displays a large **featured icon** at the top of the card with a colored background and border. The icon is chosen to match the metric type. The metric number and trend badge appear below.

    <div style={{display:"flex",gap:"16px",flexWrap:"wrap",margin:"12px 0"}}>
      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"260px",display:"flex",flexDirection:"column",gap:"24px"}}>
        <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
          <div style={{width:"48px",height:"48px",borderRadius:"28px",background:"#22C55E",border:"8px solid #16A34A",display:"flex",alignItems:"center",justifyContent:"center"}}>
            <span style={{color:"#fff",fontSize:"18px"}}>↗</span>
          </div>

          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",flexDirection:"column",gap:"8px"}}>
          <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>

          <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
            <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

            <div style={{paddingBottom:"8px"}}>
              <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",fontFamily:"Inter,sans-serif"}}>↑ 100</span>
            </div>
          </div>
        </div>
      </div>

      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"260px",display:"flex",flexDirection:"column",gap:"24px"}}>
        <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
          <div style={{width:"48px",height:"48px",borderRadius:"28px",background:"#F97316",border:"8px solid #EA580C",display:"flex",alignItems:"center",justifyContent:"center"}}>
            <span style={{color:"#fff",fontSize:"18px"}}>↘</span>
          </div>

          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",flexDirection:"column",gap:"8px"}}>
          <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Bounce Rate</span>

          <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
            <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>4,120</span>

            <div style={{paddingBottom:"8px"}}>
              <span style={{background:"#FEF3F2",color:"#B42318",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",fontFamily:"Inter,sans-serif"}}>↓ 40</span>
            </div>
          </div>
        </div>
      </div>
    </div>

    ```jsx theme={null}
    <MetricCard
      type="icon-01"
      label="Views 24 hours"
      value="2,000"
      icon={<ArrowCircleUpRightIcon />}
      trend="positive"
      change={100}
    />
    ```
  </Tab>

  <Tab title="Icon 02">
    Features an icon of the same size (48px), but with a different layout — **the icon and label are on the same row** (horizontal). The number and percentage change appear at the bottom in inline text format.

    <div style={{display:"flex",gap:"16px",flexWrap:"wrap",margin:"12px 0"}}>
      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"280px",display:"flex",flexDirection:"column",gap:"24px"}}>
        <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
          <div style={{display:"flex",gap:"16px",alignItems:"center"}}>
            <div style={{width:"48px",height:"48px",borderRadius:"28px",background:"#DBEAFE",border:"8px solid #EFF6FF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
              <span style={{color:"#1D4ED8",fontSize:"16px"}}>↗</span>
            </div>

            <span style={{fontSize:"15px",fontWeight:500,color:"#011829",fontFamily:"Inter,sans-serif",lineHeight:"24px"}}>Views 24 hours</span>
          </div>

          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",flexDirection:"column",gap:"16px"}}>
          <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

          <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
            <span style={{color:"#16A34A",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif"}}>↗ 100%</span>
            <span style={{fontSize:"13px",color:"#71717A",fontFamily:"Inter,sans-serif"}}>vs last month</span>
          </div>
        </div>
      </div>

      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"280px",display:"flex",flexDirection:"column",gap:"24px"}}>
        <div style={{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}}>
          <div style={{display:"flex",gap:"16px",alignItems:"center"}}>
            <div style={{width:"48px",height:"48px",borderRadius:"28px",background:"#FEE2E2",border:"8px solid #FFF1F2",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}}>
              <span style={{color:"#DC2626",fontSize:"16px"}}>↘</span>
            </div>

            <span style={{fontSize:"15px",fontWeight:500,color:"#011829",fontFamily:"Inter,sans-serif",lineHeight:"24px"}}>Bounce Rate</span>
          </div>

          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",flexDirection:"column",gap:"16px"}}>
          <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>4,120</span>

          <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
            <span style={{color:"#B42318",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif"}}>↘ 12%</span>
            <span style={{fontSize:"13px",color:"#71717A",fontFamily:"Inter,sans-serif"}}>vs last month</span>
          </div>
        </div>
      </div>
    </div>

    ```jsx theme={null}
    <MetricCard
      type="icon-02"
      label="Views 24 hours"
      value="2,000"
      icon={<TrendUpIcon />}
      trend="positive"
      change={100}
      changeLabel="vs last month"
    />
    ```
  </Tab>

  <Tab title="Chart">
    Displays a **mini sparkline chart** (128×64px) in the bottom-right corner of the card to visualize the data trend over a period. The label sits at the top, with the number and percentage change to the left of the chart.

    <div style={{display:"flex",gap:"16px",flexWrap:"wrap",margin:"12px 0"}}>
      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"280px",display:"flex",flexDirection:"column",gap:"24px"}}>
        <div style={{display:"flex",justifyContent:"space-between"}}>
          <span style={{fontSize:"15px",fontWeight:500,color:"#011829",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>
          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",gap:"16px",alignItems:"flex-end"}}>
          <div style={{display:"flex",flexDirection:"column",gap:"16px",flex:1}}>
            <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

            <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
              <span style={{color:"#16A34A",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif"}}>↗ 100%</span>
              <span style={{fontSize:"13px",color:"#71717A",fontFamily:"Inter,sans-serif"}}>vs last month</span>
            </div>
          </div>

          <svg width="80" height="48" viewBox="0 0 80 48" fill="none">
            <path d="M0 40 C10 38, 20 32, 30 28 C40 24, 50 20, 60 12 C65 8, 72 4, 80 2" stroke="#22C55E" strokeWidth="2" fill="none" strokeLinecap="round" />

            <path d="M0 40 C10 38, 20 32, 30 28 C40 24, 50 20, 60 12 C65 8, 72 4, 80 2 L80 48 L0 48 Z" fill="#F0FDF4" />
          </svg>
        </div>
      </div>

      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"280px",display:"flex",flexDirection:"column",gap:"24px"}}>
        <div style={{display:"flex",justifyContent:"space-between"}}>
          <span style={{fontSize:"15px",fontWeight:500,color:"#011829",fontFamily:"Inter,sans-serif"}}>Bounce Rate</span>
          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",gap:"16px",alignItems:"flex-end"}}>
          <div style={{display:"flex",flexDirection:"column",gap:"16px",flex:1}}>
            <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>4,120</span>

            <div style={{display:"flex",alignItems:"center",gap:"8px"}}>
              <span style={{color:"#B42318",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif"}}>↘ 12%</span>
              <span style={{fontSize:"13px",color:"#71717A",fontFamily:"Inter,sans-serif"}}>vs last month</span>
            </div>
          </div>

          <svg width="80" height="48" viewBox="0 0 80 48" fill="none">
            <path d="M0 8 C10 10, 20 18, 30 22 C40 26, 50 30, 60 36 C65 40, 72 44, 80 46" stroke="#EF4444" strokeWidth="2" fill="none" strokeLinecap="round" />

            <path d="M0 8 C10 10, 20 18, 30 22 C40 26, 50 30, 60 36 C65 40, 72 44, 80 46 L80 48 L0 48 Z" fill="#FEF2F2" />
          </svg>
        </div>
      </div>
    </div>

    ```jsx theme={null}
    <MetricCard
      type="chart"
      label="Views 24 hours"
      value="2,000"
      trend="positive"
      change={100}
      changeLabel="vs last month"
      chartData={[12, 18, 14, 22, 28, 35, 42, 50]}
    />
    ```
  </Tab>
</Tabs>

## Actions

The `actions` prop adds a **"View report"** button at the bottom of the card, which can be used to navigate to a detailed report page.

<div style={{display:"flex",gap:"16px",flexWrap:"wrap",margin:"16px 0"}}>
  <div style={{display:"flex",flexDirection:"column",gap:"8px"}}>
    <p style={{fontSize:"12px",color:"#71717A",fontFamily:"Inter,sans-serif",margin:0}}>actions=false (default)</p>

    <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"260px",display:"flex",flexDirection:"column",gap:"8px"}}>
      <div style={{display:"flex",justifyContent:"space-between"}}>
        <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>
        <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
      </div>

      <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
        <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

        <div style={{paddingBottom:"8px"}}>
          <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",fontFamily:"Inter,sans-serif"}}>↑ 100</span>
        </div>
      </div>
    </div>
  </div>

  <div style={{display:"flex",flexDirection:"column",gap:"8px"}}>
    <p style={{fontSize:"12px",color:"#71717A",fontFamily:"Inter,sans-serif",margin:0}}>actions=true</p>

    <div style={{background:"#FFFFFF",borderRadius:"8px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"260px",display:"flex",flexDirection:"column",overflow:"hidden"}}>
      <div style={{padding:"24px",display:"flex",flexDirection:"column",gap:"8px"}}>
        <div style={{display:"flex",justifyContent:"space-between"}}>
          <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>
          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
          <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

          <div style={{paddingBottom:"8px"}}>
            <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",fontFamily:"Inter,sans-serif"}}>↑ 100</span>
          </div>
        </div>
      </div>

      <div style={{borderTop:"1px solid #F4F4F5",padding:"12px 24px"}}>
        <span style={{fontSize:"14px",fontWeight:500,color:"#0479CE",fontFamily:"Inter,sans-serif",cursor:"pointer"}}>View report →</span>
      </div>
    </div>
  </div>
</div>

```jsx theme={null}
// With action button
<MetricCard
  type="simple"
  label="Views 24 hours"
  value="2,000"
  trend="positive"
  change={100}
  actions
  onViewReport={() => router.push("/reports/views")}
/>
```

## Trend Indicator

Every Metric Card displays a trend indicator to show the change compared to the previous period.

### Badge (Simple & Icon 01)

<div style={{display:"flex",gap:"12px",margin:"12px 0"}}>
  <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"Inter,sans-serif"}}>↑ 100 <span style={{fontSize:"11px",color:"#027A48"}}>Positive</span></span>
  <span style={{background:"#FEF3F2",color:"#B42318",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"Inter,sans-serif"}}>↓ 40 <span style={{fontSize:"11px",color:"#B42318"}}>Negative</span></span>
</div>

| 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)

<div style={{display:"flex",gap:"16px",margin:"12px 0",alignItems:"center"}}>
  <span style={{color:"#16A34A",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif",display:"inline-flex",alignItems:"center",gap:"4px"}}>↗ 100% <span style={{fontSize:"12px",color:"#71717A",fontWeight:400}}>vs last month</span></span>
  <span style={{color:"#B42318",fontSize:"14px",fontWeight:500,fontFamily:"Inter,sans-serif",display:"inline-flex",alignItems:"center",gap:"4px"}}>↘ 12% <span style={{fontSize:"12px",color:"#71717A",fontWeight:400}}>vs last month</span></span>
</div>

| State    | Color                 | Icon               |
| -------- | --------------------- | ------------------ |
| Positive | `#16A34A` (Green/07)  | `arrow-up-right`   |
| Negative | `#B42318` (Error/700) | `arrow-down-right` |

## Breakpoints

<Tabs>
  <Tab title="Desktop">
    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              |
  </Tab>

  <Tab title="Mobile">
    Card width is **328px** (inside a 360px container with 16px left/right padding). The layout does not change significantly — only the width adapts. The `actions` prop is not available on the mobile variant.

    | Property      | Value               |
    | ------------- | ------------------- |
    | Width         | 328px               |
    | Padding       | 24px                |
    | Metric number | 36px Inter SemiBold |
    | Actions       | Not available       |

    <div style={{display:"flex",justifyContent:"center",margin:"12px 0"}}>
      <div style={{background:"#FFFFFF",borderRadius:"8px",padding:"24px",boxShadow:"0px 1px 3px rgba(16,24,40,0.1),0px 1px 2px rgba(16,24,40,0.06)",width:"280px",display:"flex",flexDirection:"column",gap:"8px"}}>
        <div style={{display:"flex",justifyContent:"space-between"}}>
          <span style={{fontSize:"14px",fontWeight:500,color:"#71717A",fontFamily:"Inter,sans-serif"}}>Views 24 hours</span>
          <span style={{color:"#A1A1AA",fontSize:"18px"}}>⋮</span>
        </div>

        <div style={{display:"flex",alignItems:"flex-end",gap:"16px"}}>
          <span style={{fontSize:"36px",fontWeight:600,color:"#011829",fontFamily:"Inter,sans-serif",letterSpacing:"-0.72px",lineHeight:"44px"}}>2,000</span>

          <div style={{paddingBottom:"8px"}}>
            <span style={{background:"#ECFDF3",color:"#027A48",fontSize:"13px",fontWeight:500,padding:"2px 8px 2px 10px",borderRadius:"16px",fontFamily:"Inter,sans-serif"}}>↑ 100</span>
          </div>
        </div>
      </div>
    </div>
  </Tab>
</Tabs>

## 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`

<ParamField path="type" type="&#x22;simple&#x22; | &#x22;icon-01&#x22; | &#x22;icon-02&#x22; | &#x22;chart&#x22;" required>
  The display type of the metric card.
</ParamField>

<ParamField path="label" type="string" required>
  The metric label text, displayed above the number.
</ParamField>

<ParamField path="value" type="string | number" required>
  The primary metric value displayed large (e.g. `"2,000"`, `"89%"`).
</ParamField>

<ParamField path="trend" type="&#x22;positive&#x22; | &#x22;negative&#x22;" required>
  The direction of the metric change — determines the color and icon of the trend indicator.
</ParamField>

<ParamField path="change" type="number" required>
  The numeric change value (e.g. `100` → displayed as `↑ 100` or `100%`).
</ParamField>

<ParamField path="changeLabel" type="string" default="&#x22;vs last month&#x22;">
  The descriptive text for the change. Only shown on `icon-02` and `chart` types.
</ParamField>

<ParamField path="icon" type="ReactNode">
  The icon displayed in the featured icon area. Required for `icon-01` and `icon-02` types.
</ParamField>

<ParamField path="chartData" type="number[]">
  Data array for the sparkline chart. Required for the `chart` type.
</ParamField>

<ParamField path="actions" type="boolean" default="false">
  If `true`, displays a "View report" button at the bottom of the card (Desktop only).
</ParamField>

<ParamField path="onViewReport" type="() => void">
  Callback fired when the "View report" button is clicked. Required when `actions` is `true`.
</ParamField>

<ParamField path="breakpoint" type="&#x22;desktop&#x22; | &#x22;mobile&#x22;" default="&#x22;desktop&#x22;">
  The rendering breakpoint of the card. Mobile does not support the `actions` prop.
</ParamField>

<ParamField path="className" type="string">
  Additional class name for custom styling.
</ParamField>

## Accessibility

* Use a descriptive `aria-label` on 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-label` if it only shows an icon
* Ensure the trend badge color contrast meets WCAG AA (green `#027A48` on `#ECFDF3` ✓)
* The sparkline chart should include `role="img"` and an `aria-label` describing the trend

## Do's & Don'ts

<CardGroup cols={2}>
  <Card title="Do" icon="check" iconType="solid" color="#16A34A">
    * Use one metric per card
    * Ensure `changeLabel` provides clear context (e.g. "vs last week")
    * Choose the `chart` type for metrics with significant fluctuations that need to be visualized
    * Arrange cards in a 3–4 column grid on desktop
    * Use the `icon-01` type for metrics with a clear visual category (sales, traffic, etc.)
  </Card>

  <Card title="Don't" icon="xmark" iconType="solid" color="#DC2626">
    * Don't display more than one large number per card
    * Don't use the `chart` type for static data (with no change over time)
    * Don't let `value` get too long — truncate if needed (e.g. `2.3M` not `2,312,400`)
    * Don't hide the trend indicator — always provide change context
    * Don't use `actions=true` without a working `onViewReport` handler
  </Card>
</CardGroup>
