Examples

Budget report

Built with the mantine-data-grid skill

5 departments · 63 entries

Department / cost line
Variance %

Engineering

$488,200$500,200
+$12,000
+2.5%

Platform

$78,700$78,100
-$600
-0.8%

Product

$82,700$86,900
+$4,200
+5.1%

Security

$114,100$119,200
+$5,100
+4.5%

Quality

$212,700$216,000
+$3,300
+1.6%

Operations

$465,700$485,300
+$19,600
+4.2%

Logistics

$128,900$135,400
+$6,500
+5%

Facilities

$150,900$154,000
+$3,100
+2.1%

Procurement

$185,900$195,900
+$10,000
+5.4%

Sales

$348,900$357,800
+$8,900
+2.6%

Field sales

$122,500$122,700
+$200
+0.2%

Partnerships

$135,900$144,000
+$8,100
+6%

Enablement

$90,500$91,100
+$600
+0.7%

Finance

$216,400$223,000
+$6,600
+3%

Accounting

$128,300$127,600
-$700
-0.5%

Planning

$88,100$95,400
+$7,300
+8.3%

People

$222,200$228,800
+$6,600
+3%

Talent

$95,100$100,900
+$5,800
+6.1%

Workplace

$127,100$127,900
+$800
+0.6%
Company total$1,741,400$1,795,100
+$53,700
+3.1%

Build the budget report of a finance app: the annual budget of a company, broken down by department, team and cost line, with planned and actual spending.

Data:

  • generated data for one year: 5 departments, 2–4 teams each, 3–6 cost lines per team (for example "Cloud hosting", "Contractors", "Travel")
  • each cost line has a planned and an actual amount per quarter

Table:

  • rows form a tree: department, team, cost line; each department and team shows the sum of the rows under it
  • columns: name, planned, actual, variance (actual minus planned) and variance percent; the year totals are shown by default
  • each level can be expanded and collapsed, and there are "Expand all" and "Collapse all" controls; departments are expanded on load
  • over-budget variances are visible without relying on color alone
  • money columns are right-aligned with digits of equal width, formatted as currency without cents
  • the name column stays visible while the other columns scroll horizontally
  • a total row for the whole company stays visible at the bottom of the table
  • sortable by planned, actual and variance; sorting keeps the tree and sorts within each level

View options:

  • a period control switches between the full year and one quarter; all amounts and sums follow the period
  • a "Group by cost line" option regroups the table by cost line name across all teams, with a sum per cost line
  • "Export CSV" downloads the rows as currently shown, including sums, with the hierarchy visible in the name column

The component is shown on a demo page that already has a title: do not add a page title or intro text.

Write tests for the component.