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
vue
<template>
<BlessBudgetBars :budgets currency="IDR" locale="id-ID" style="max-width: 440px" />
</template>
<script setup lang="ts">
import { BlessBudgetBars } from "blessing-ui";
// the November budget of a small podcast
const budgets = [
{ name: "Gear", spent: 1450000, budget: 1200000 },
{ name: "Hosting", spent: 150000, budget: 150000 },
{ name: "Guests and food", spent: 420000, budget: 800000 },
{ name: "Ads", spent: 250000, budget: 1000000 },
];
</script>budgetsis a list of categories. Each category has aname, the moneyspent, and thebudget.- 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.
currencyis an ISO 4217 code (defaultUSD), andlocalesets the format. The amounts have no decimals.- The bars are hidden from screen readers, because the text says the same. Change the words with
labelsor a label pack:title,total, and the functionsof,left, andover.
Usage
ts
import { BlessBudgetBars } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
budgets* | BlessBudget[] | — | |
currency | string | "USD" | |
locale | string | "en" | |
labels | Partial<{ title: string; of: (spent: string, budget: string) => string; left: (amount: string) => string; over: (amount: string) => string; total: string; }> | — |