Skip to content
Calm motion: animations on this site only fade, with no movement

Budget bars ​

The money spent against the plan for each category, with what is left

Shows a budget at a glance in a finance or team app. Each category has a bar, and a total row comes last. For the use of a plan limit, such as storage, use quota usage.

Basic
GearRp 1.450.000 of Rp 1.200.000
Rp 250.000 over
HostingRp 150.000 of Rp 150.000
Rp 0 left
Guests and foodRp 420.000 of Rp 800.000
Rp 380.000 left
AdsRp 250.000 of Rp 1.000.000
Rp 750.000 left
TotalRp 2.270.000 of Rp 3.150.000
Rp 880.000 left
  • budgets is a list of categories. Each category has a name, the money spent, and the budget.
  • Each row shows "spent of budget", a bar, and the money that is left. If the spending is more than the budget, the line says "over", and the bar is full and striped. The color only repeats this.
  • The last row is the total of all the categories.
  • currency is an ISO 4217 code (default USD), and locale sets the format. The amounts have no decimals.
  • The bars are hidden from screen readers, because the text says the same. Change the words with labels or a label pack: title, total, and the functions of, left, and over.

Usage ​

ts
import { BlessBudgetBars } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
budgets*BlessBudget[]—
currencystring"USD"
localestring"en"
labelsPartial<{ title: string; of: (spent: string, budget: string) => string; left: (amount: string) => string; over: (amount: string) => string; total: string; }>—

Released under the MIT License. Character names and artwork belong to their owners.