Breakdown
Amounts with subtotals and a total.
On this page
Examples
Invoice and comparison
Amounts are decimals, formatted with Format and Culture. Two amounts per line switch the block to two columns, and Collapsible hides the lines while keeping the total.
Invoice
LicensesNew12 seats
1 400,00 €
Support
0,00 €
Discount
-165,50 €
Total
1 234,50 €
VAT included
Year over year
2026
2025
Total
$2,200$1,900
Razor
<div class="grid w-full gap-4 md:grid-cols-2">
<KlyBreakdown Title="Invoice" Format="C2" Culture="@_fr" Lines="@_lines" Total="@(new KlyBreakdownLine("Total") { Amount = 1234.5m })" Footnote="VAT included" Surface="KlySurface.Bordered" />
<KlyBreakdown Title="Year over year" Format="C0" Culture="@_en" Collapsible CompareColumns="@(new KlyBreakdownColumns("2026", "2025"))" Lines="@_compare"
Total="@(new KlyBreakdownLine("Total") { Amount = 2200m, CompareAmount = 1900m })" Surface="KlySurface.Bordered" />
</div>
@code {
private readonly System.Globalization.CultureInfo _fr = System.Globalization.CultureInfo.GetCultureInfo("fr-FR");
private readonly System.Globalization.CultureInfo _en = System.Globalization.CultureInfo.GetCultureInfo("en-US");
private readonly KlyBreakdownLine[] _lines =
[
new("Licenses") { Amount = 1400m, Detail = "12 seats", Badge = new KlyBadgeItem("New") },
new("Support") { Amount = 0m, IsMuted = true },
new("Discount") { Amount = -165.5m, Color = KlyColor.Success },
];
private readonly KlyBreakdownLine[] _compare =
[
new("Licenses") { Amount = 1400m, CompareAmount = 1200m },
new("Support") { Amount = 800m, CompareAmount = 700m },
];
}API
KlyBreakdown
A list of labelled amounts with subtotal rows and a total row, optionally in two columns or behind a toggle.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
Class |
string |
Classes added to the root element, merged last so they win over the theme. | |
Collapsible |
bool |
false |
Hides the lines behind a toggle. The total, the headers of the columns and the footnote stay visible. |
CompareColumns |
KlyBreakdown |
The headers of the two amount columns, for example new KlyBreakdownColumns("2026", "2025") : Amount goes under First and CompareAmount under Second , for the lines and the total. A line without a second amount shows a dash. Setting a CompareAmount on any line also switches to two columns, without headers. | |
Culture |
CultureInfo |
The culture that formats the amounts. Defaults to the format culture of the locale in effect. | |
DefaultOpen |
bool |
false |
Whether a collapsible block starts open. It is read once, when the component first receives its parameters. |
Footnote |
string |
A line of smaller text under the block. | |
Format |
string |
"N2" |
The .NET numeric format string of the amounts ( "N2" by default; "C2" shows the currency of Culture ). |
Lines |
IReadOnlyList |
The lines, as KlyBreakdownLine . | |
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 title of the block. | |
Total |
KlyBreakdownLine |
The total row, shown below the lines. | |
Ui |
BreakdownUi |
Per-instance class overrides of the slots of the breakdown, see BreakdownUi . They are merged after the theme and the Class parameter wins on the root slot. |
Ui slots
Ui takes a BreakdownUi with one class string per slot, merged after the theme.
| Slot | Styles |
|---|---|
Root |
Classes merged into the root slot of KlyBreakdown , after the theme and the app configuration. |
Title |
Classes merged into the title slot of KlyBreakdown , after the theme and the app configuration. |
Toggle |
Classes merged into the toggle slot of KlyBreakdown , after the theme and the app configuration. |
ToggleIcon |
Classes merged into the toggleIcon slot of KlyBreakdown , after the theme and the app configuration. |
Columns |
Classes merged into the columns slot of KlyBreakdown , after the theme and the app configuration. |
ColumnHeader |
Classes merged into the columnHeader slot of KlyBreakdown , after the theme and the app configuration. |
Lines |
Classes merged into the lines slot of KlyBreakdown , after the theme and the app configuration. |
Row |
Classes merged into the row slot of KlyBreakdown , after the theme and the app configuration. |
Subtotal |
Classes merged into the subtotal slot of KlyBreakdown , after the theme and the app configuration. |
Muted |
Classes merged into the muted slot of KlyBreakdown , after the theme and the app configuration. |
Total |
Classes merged into the total slot of KlyBreakdown , after the theme and the app configuration. |
Label |
Classes merged into the label slot of KlyBreakdown , after the theme and the app configuration. |
LabelRow |
Classes merged into the labelRow slot of KlyBreakdown , after the theme and the app configuration. |
Detail |
Classes merged into the detail slot of KlyBreakdown , after the theme and the app configuration. |
Amount |
Classes merged into the amount slot of KlyBreakdown , after the theme and the app configuration. |
CompareAmount |
Classes merged into the compareAmount slot of KlyBreakdown , after the theme and the app configuration. |
Footnote |
Classes merged into the footnote slot of KlyBreakdown , after the theme and the app configuration. |
Skeleton |
Classes merged into the skeleton slot of KlyBreakdown , after the theme and the app configuration. |