Skip to main content

Budgeting: Penny Pro

Penny reads transactions and never moves money. Budgets turn amber from 80% and red when over; splitting a payment halves what counts against your budget.

See it live, on any device

Use the whole app​

import { BudgetApp } from '@patine-ui/pro';

<BudgetApp />;
PropTypeDefault
initialRoute'overview' | 'activity' | 'budgets' | 'insights' | 'goals' | 'bills' | 'add' | 'settings''overview'
demo'ready' | 'loading' | 'empty' | 'error''ready'
insets{ top, bottom }None
platform'ios' | 'android' | 'web'Platform.OS

Screens move the platform's way: on iOS a pushed screen slides in from the trailing edge, on Android they fade through, on the web and between tabs they fade in. Reduce motion turns it off.

Screens​

ScreenWhat it does
BudgetOverviewScreenSafe to spend today, StatsRow, cash flow on a ComboChart, budgets closest to their limit, bills coming up
BudgetActivityScreenTransactions by day with totals, search and filters, SwipeableRow to split or hide, a BottomSheet to change the category
BudgetsScreenRadialChart rings, budgets on SortableList with handles, an AlertDialog with a Slider to change a limit
InsightsScreenPlain-language notes, stacked BarChart by category, a DonutChart and a spending HeatmapChart
GoalsScreenThe main goal on a GaugeChart, savings with a dashed plan, goals with progress and on-track badges
BillsScreenPro's Agenda of due dates, subscriptions with brand logos, bills to pay by hand
AddExpenseScreenA big amount, category tiles, DatePickerField and a split with AvatarGroup
BudgetSettingsScreenLinked accounts with brand logos, budgeting and notification switches

Every screen is exported on its own, takes its data as props, and has sample data as defaults. budgetsFor(txns, today) gives each budget's spent, left and state; monthSummary the safe-to-spend figure; goalStatus whether a goal is on track.

Built with​

The free components, from patine-ui:

AlertDialog · Avatar · AvatarGroup · Badge · BottomSheet · Button · Card · ChipGroup · DatePickerField · DescriptionList · Heading, Text · List, ListItem · Progress · SearchField · Separator · Slider · SortableHandle, SortableList · Stat · SwipeableRow · Switch · TextField

And from Patine Pro:

Files​

budget/
├── components/
│ ├── BudgetRow.tsx
│ └── TxnRow.tsx
├── hooks/
│ ├── useBudgetApp.ts
│ ├── useBudgetScreens.ts
│ └── useSpendDays.ts
├── AddExpenseScreen.tsx
├── BillsScreen.tsx
├── budget.constants.ts
├── budget.types.ts
├── budget.utils.ts
├── BudgetActivityScreen.tsx
├── BudgetApp.tsx
├── BudgetLimitsScreen.tsx
├── BudgetOverviewScreen.tsx
├── BudgetSettingsScreen.tsx
├── GoalsScreen.tsx
├── index.ts
└── InsightsScreen.tsx

It also uses shared/, the theme, money formatting and screen transitions every Pro app shares.

A look at the code​

Whether a savings goal is on track and what it needs each month, from budget.utils.ts:

/** Where a goal stands: how far along, what's left, and whether what goes in each month gets there by the date. */
export const goalStatus = (goal: Goal, today: Date) => {
const months = monthsUntil(goal.by, today);
const left = Math.max(0, goal.target - goal.saved);
const projected = goal.saved + goal.monthly * months;
return {
ratio: goal.target ? goal.saved / goal.target : 0,
left,
months,
onTrack: projected >= goal.target,
/** What it would take each month to get there in time */
needed: months ? Math.ceil(left / months) : left,
};
};
Get the source with Pro