Skip to content

Block 155 of 297

Budget Snapshot

Where tax dollars go: spending categories as sorted bars labeled with dollars and percent of total.

Puck key
BudgetSnapshotBlock
Export
budgetSnapshotBlock
React component
<BudgetSnapshot />
Path
components/puck/budget-snapshot-block.tsx
Dependencies
None
License
MIT

About this block

When to use it, how to write for it, and what to change in the code.

What it's for

A two-part budget summary: fiscal year, heading, total and links on the left, and a ranked bar list of spending categories on the right. The block sorts categories from largest to smallest and calculates each share from the amounts entered. The columns stack on smaller screens. It suits a finance or transparency page that needs a quick answer to where the money goes.

  • A city or county "Where your tax dollars go" page
  • A budget season explainer linked from a council agenda
  • A park district or library annual report section
Writing the content
  • Enter each Amount (dollars) as a whole number with no commas, like 12400000. The display rounds to a compact form such as $12.4M.
  • Total budget is shown exactly as typed and is not calculated, so check it matches the sum of your categories. The line above it always reads "Total general fund".
  • Always fill in Source with the document the figures come from; it prints under the bars.
  • Keep What it pays for to a short phrase. You can list up to 12 categories.
Accessibility
  • Every bar states its dollar amount and percentage as text; the bars themselves are hidden from screen readers, so no information depends on bar length or color alone (WCAG 1.4.1).
  • Categories are an ordered list, which matches their largest-first ranking (WCAG 1.3.1).
Customizing the code
  • The largest bar uses bg-indigo-700 and the rest bg-indigo-500; change both in the bar's className to rebrand.
  • Currency formatting comes from the money constant (Intl.NumberFormat, USD, compact notation); edit it for a different currency or full figures.

Editor fields

What content editors see in the P1 sidebar when they select this block.

  • Headingtext
  • Heading levelselect
  • Introtextarea
  • Fiscal yeartext
  • Total budgettext
  • Spending categoriesarray
  • Sourcetext
  • Explore link texttext
  • Explore linktext
  • Download link texttext
  • Download linktext