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 deviceUse the whole app
import { BudgetApp } from '@patine-ui/pro';
<BudgetApp />;
| Prop | Type | Default |
|---|---|---|
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
| Screen | What it does |
|---|---|
BudgetOverviewScreen | Safe to spend today, StatsRow, cash flow on a ComboChart, budgets closest to their limit, bills coming up |
BudgetActivityScreen | Transactions by day with totals, search and filters, SwipeableRow to split or hide, a BottomSheet to change the category |
BudgetsScreen | RadialChart rings, budgets on SortableList with handles, an AlertDialog with a Slider to change a limit |
InsightsScreen | Plain-language notes, stacked BarChart by category, a DonutChart and a spending HeatmapChart |
GoalsScreen | The main goal on a GaugeChart, savings with a dashed plan, goals with progress and on-track badges |
BillsScreen | Pro's Agenda of due dates, subscriptions with brand logos, bills to pay by hand |
AddExpenseScreen | A big amount, category tiles, DatePickerField and a split with AvatarGroup |
BudgetSettingsScreen | Linked 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:
- Agenda PRO
- App shell and layout PRO
- Bar chart PRO
- Brand logos PRO
- Combo chart PRO
- Gauge chart PRO
- Heatmap PRO
- Line chart PRO
- Pie chart PRO
- Radial chart PRO
- Stats row 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,
};
};