← All Components
<mth-stat-card>
Dashboard KPI stat card with FormattingUtils locale-aware formatting, directional trend indicator, and sparkline/footer slots.
When NOT to use: Use a lightweight @methane-ui/css layout class instead of a custom element when static CSS suffices.
Live Interactive Preview
Ready · interact with <mth-stat-card>, or toggle Theme, Direction (LTR/RTL), or props above.
Multi-Framework Playground & Snippets
<script type="module" src="@methane-ui/ui/stat-card"></script>
<mth-stat-card format="none" currency="USD">Example</mth-stat-card>import '@methane-ui/ui/stat-card';
import '@methane-ui/react';
export function Example() {
return <mth-stat-card format="none" currency="USD">Example</mth-stat-card>;
}<script setup lang="ts">
import '@methane-ui/ui/stat-card';
</script>
<template>
<mth-stat-card format="none" currency="USD">Example</mth-stat-card>
</template>import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@methane-ui/ui/stat-card';
import { MthStatCardDirective } from '@methane-ui/angular';
@Component({
standalone: true,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
imports: [MthStatCardDirective],
template: `<mth-stat-card format="none" currency="USD">Example</mth-stat-card>`,
})
export class ExampleComponent {}<script lang="ts">
import '@methane-ui/ui/stat-card';
import MthStatCard from '@methane-ui/svelte/MthStatCard.svelte';
</script>
<MthStatCard format="none" currency="USD">Example</MthStatCard>Properties & Attributes
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
label | label | string | "" | Metric title label. |
value | value | string | "" | Raw or numeric metric value string. |
format | format | 'none' | 'number' | 'compact' | 'currency' | 'percent' | "none" | Optional Intl formatting preset (none, number, compact, currency, percent). |
currency | currency | string | "USD" | ISO 4217 currency code used when format="currency". |
delta | delta | string | "" | Comparison delta string (e.g. +12.4%). |
trend | trend | 'neutral' | 'up' | 'down' | "neutral" | Directional sentiment (up, down, neutral). |
hint | hint | string | "" | Secondary comparison period or caption text. |
variant | variant | 'elevated' | 'outlined' | 'subtle' | "elevated" | Card surface style (elevated, outlined, subtle). |
Accessibility Checklist
| Category | Requirement | Verified By |
|---|---|---|
| aria | All aria-* IDREFs resolve within the same DOM root (ADR-003). | scanSameRootAria |
| focus | Focus ownership matches focusModel="none". | lint-plugin & spec-compiler |
| contrast | Renders legible borders, focus outlines, and selection indicators under forced-colors: active. | Playwright forced-colors matrix |
| states | Exposes ElementInternals CustomStateSet flags: :state(trend-up), :state(trend-down), :state(trend-neutral). | Conformance suite |
| i18n | Routes 4 UI/ARIA strings through @methane-ui/core i18n catalog. | Locale context test |