Skip to content
Blocks StatGroup

StatGroup

Small metrics side by side.

On this page

Examples

Metrics in a row

This week
Errors 12
Users 340+8
Deploys 27
Razor
<div class="w-full max-w-2xl">
    <KlyStatGroup Title="This week" Surface="KlySurface.Bordered" Items="@(new[]
    {
        new KlyStatItem<int>("Errors", 12) { Color = KlyColor.Error },
        new KlyStatItem<int>("Users", 340) { Caption = "+8" },
        new KlyStatItem<int>("Deploys", 27) { Color = KlyColor.Success },
    })" />
</div>

API

KlyStatGroup<TValue>

Several small metrics side by side under an optional title (the "row" of statistics). is the number type of every value.

Parameters

Name Type Default Description
Class string Classes added to the root element, merged last so they win over the theme.
Culture CultureInfo The culture that formats the values. Defaults to the format culture of the locale in effect.
Format string "#,0.##" The .NET numeric format string of the values ( "#,0.##" by default).
Items IReadOnlyList<KlyStatItem<TValue>> The metrics, as KlyStatItem`1 .
Loading bool false Shows a skeleton placeholder instead of the content.
Surface KlySurface? The surface treatment. Bordered when not set. Values: Plain, Muted, Bordered, Elevated.
Title string The line above the metrics.
Ui StatGroupUi Per-instance class overrides of the slots of the stat group, see StatGroupUi . They are merged after the theme and the Class parameter wins on the root slot.

Ui slots

Ui takes a StatGroupUi with one class string per slot, merged after the theme.

Slot Styles
Root Classes merged into the root slot of KlyStatGroup`1 , after the theme and the app configuration.
Title Classes merged into the title slot of KlyStatGroup`1 , after the theme and the app configuration.
Grid Classes merged into the grid slot of KlyStatGroup`1 , after the theme and the app configuration.
Item Classes merged into the item slot of KlyStatGroup`1 , after the theme and the app configuration.
Label Classes merged into the label slot of KlyStatGroup`1 , after the theme and the app configuration.
Value Classes merged into the value slot of KlyStatGroup`1 , after the theme and the app configuration.
Caption Classes merged into the caption slot of KlyStatGroup`1 , after the theme and the app configuration.
Skeleton Classes merged into the skeleton slot of KlyStatGroup`1 , after the theme and the app configuration.