Skip to content

Category Budget

A month's budget by category. A donut shows where the money went; the total sits against the limit with how far ahead of an even pace it is. Each category has spent, left or over, and a bar with a marker at today's pace, so 71% on day 18 of 31 reads as a warning before it is a problem. Tap a row for a sheet that sets the limit, the alert threshold and rollover.

On this page

Examples

Installation

npx knowns-ui@latest add category-budget
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

lines
BudgetLine[]
category, spent and limit, plus alertAt (0 to 1, default 0.8) and rollover.
day / days
number / number
Where the period is: the pace marker sits at day / days.
periodLabel
string
The period's name in the header, e.g. December.
categories
ExpenseCategory[]
Defaultsix defaults
Names, colours and glyphs.
history
Record<string, number[]>
Past totals by category, shown in the edit sheet as a guide.
onLimitChange
(category, { limit, alertAt, rollover }) => void
Makes the rows open the edit sheet. Without it the block is read-only.
step
number
Default50
Step of the - and + buttons.
rolloverShare
number
Default0.2
How much rollover carries, as a share of the limit.
editing / defaultEditing / onEditingChange
string | null / string | null / (category) => void
Default - / null / -
The category whose limit sheet is open, controlled or not: a link straight to one limit.
currency / locale
string / string
Default"USD" / en-US
How amounts are written.

When to use

When to use

  • A month's spending against a limit for each category, with today's pace so overspending shows before the month ends.
  • Setting a limit, an alert threshold and rollover from the same screen.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Category Budget to my app and wire it to my own data.
  • I need a month's spending against a limit for each category, with today's pace so overspending shows before the month ends. Set that up with the Knowns UI Category Budget.
  • Which Category Budget props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "category-budget" }) and search_docs({ query: "category budget" }).

Need help?

Stuck on Category Budget, or found something off? We read every message.