Methane@methane-ui/*
CSS LayoutsComponentsSkillsTheme BuilderGitHub
← All Components

<mth-stat-card>

@methane-ui/ui~6.8 KB brotli (cold + Lit)~1.4 KB marginal

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

Interactive StageLive Custom Element · <mth-stat-card> (@methane-ui/ui)
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>

Properties & Attributes

PropertyAttributeTypeDefaultDescription
labellabelstring""Metric title label.
valuevaluestring""Raw or numeric metric value string.
formatformat'none' | 'number' | 'compact' | 'currency' | 'percent'"none"Optional Intl formatting preset (none, number, compact, currency, percent).
currencycurrencystring"USD"ISO 4217 currency code used when format="currency".
deltadeltastring""Comparison delta string (e.g. +12.4%).
trendtrend'neutral' | 'up' | 'down'"neutral"Directional sentiment (up, down, neutral).
hinthintstring""Secondary comparison period or caption text.
variantvariant'elevated' | 'outlined' | 'subtle'"elevated"Card surface style (elevated, outlined, subtle).

Accessibility Checklist

CategoryRequirementVerified By
ariaAll aria-* IDREFs resolve within the same DOM root (ADR-003).scanSameRootAria
focusFocus ownership matches focusModel="none".lint-plugin & spec-compiler
contrastRenders legible borders, focus outlines, and selection indicators under forced-colors: active.Playwright forced-colors matrix
statesExposes ElementInternals CustomStateSet flags: :state(trend-up), :state(trend-down), :state(trend-neutral).Conformance suite
i18nRoutes 4 UI/ARIA strings through @methane-ui/core i18n catalog.Locale context test