Stat

Statistics with responsive groups and composable slots

Stat

Import

@import "tailwindcss";
@import "@duskmoon-dev/core";

Individual CSS: @duskmoon-dev/core/components/stat.css (also available via the style export condition on @duskmoon-dev/core/components/stat). JavaScript import { css, styles } from "@duskmoon-dev/core/components/stat" exposes CSS text and a nullable CSSStyleSheet (null during SSR). It is not an interaction runtime.

Example

Stat composition

Service health

Successful requests
98.4%
Last 24 hours
View report
Requests
24,800
Across all regions

API And Accessibility

Use stats for the group and stat for each item. Slots: stat-title, stat-value, stat-desc, stat-figure, stat-actions. Groups support stats-horizontal (default), stats-vertical, and container-responsive stats-responsive (vertical below 32rem). Semantic variants: stat-primary, stat-secondary, stat-tertiary, stat-info, stat-success, stat-warning, stat-error.

Use a labeled section or definition list; include units and the measurement period. Formatting, localization, aggregation and trend calculations belong to the application. Large values wrap rather than truncate. No JavaScript is required.