Free
Pro

Stat Card

A dashboard metric card that displays a prominent value, descriptive label, optional trend, and icon — or, with variant="metric", a Motif-style KPI tile with delta pill, sparkline, and caption.

free

Active users

2,845

+12.4%

Playground

variant
color
-50

HTML

<ply-stat-card variant="classic" value="2,845" label="Active users" trend="+12.4%" color="primary" [delta]="-50">Stat Card</ply-stat-card>

Basic Stat Card

Provide value and label as the minimum configuration.

Total Revenue

48,295

Active Users

1,842

With Icon and Color

Add icon and color to show a colored icon badge. Supported colors: primary, success, danger, warning, accent.

Revenue

$48,295

Active Users

1,842

Open Issues

23

Uptime

98.2%

With Trend Indicator

Use trend and [trendUp] to show a directional indicator. Add caption for comparison context.

Revenue

$48,295

+12.5% vs last month

New Orders

284

+8.3% vs last week

Refunds

34

-3.1% vs last month

Metric / sparkline

Set variant="metric" for the Motif Admin KPI layout: uppercase label, delta pill from a ratio ([delta]="0.062"+6.2%), inline sparkline from [series], and a footer caption. No Pro chart dependency — the sparkline is drawn in the card.

Net revenue

+6.2%

$248,910

vs $210K previous period

Orders

+7.9%

1,284

vs 1,190 previous period

Refunds

−7.7%

48

vs 52 previous period

Conversion

+10.7%

3.1%

vs 2.8% previous period

Installation

Run the following command to add this component to your project:

bash

npx ply-ui-cli add stat-card

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.

bash

npx -y ply-ui-mcp

Ply provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

// Install: npx ply-ui-cli add stat-card
// Paths are relative to aliases.components (default: src/app/components)
import { StatCardComponent } from './stat-card/stat-card.component';

@Component({
  selector: 'app-your-component',
  imports: [
    StatCardComponent
  ],
  template: `...`
})
export class YourComponent {}

API for stat-card — generated from JSDoc in the library source.

API reference for stat-card
APIMemberTypeDefaultDescription
ply-stat-cardclassstring''Extra host classes merged via `cn()`.
ply-stat-cardvariantStatCardVariant'classic'Layout mode. `classic` is the icon-left tile; `metric` is the Motif-style vertical stack with delta pill and sparkline.
ply-stat-cardvaluestring''The large metric value.
ply-stat-cardlabelstring''Label rendered above the value (classic) or as a micro uppercase header (metric).
ply-stat-cardtrendstring | undefinedundefinedPreformatted trend text for classic mode (e.g. `"+12.5%"`).
ply-stat-cardtrendUpboolean | undefinedundefinedClassic mode: `true` = green up arrow, `false` = red down arrow.
ply-stat-cardiconstring | undefinedundefinedOptional icon name for classic mode (tinted bubble).
ply-stat-cardcolorStatCardColor'primary'Tint for the classic icon bubble.
ply-stat-cardcaptionstring | undefinedundefinedComparison caption. Classic: shown beside the trend when `trend` is set. Metric: always shown under the sparkline when non-empty.
ply-stat-carddeltanumber | undefinedundefinedMetric mode: period-over-period change as a ratio (`0.062` → `+6.2%`). Drives the delta pill and sparkline stroke color.
ply-stat-cardseriesreadonly number[][]Metric mode: sparkline series. Empty/omitted hides the chart.