Connor Adams · Design System

finance

CategoryBreakdown

Spend, with trend

Net spend by category

This month · transfers excluded

Groceries$842.00
Dining$586.00
Transport$418.00
Subscriptions$214.00
Utilities$176.00

Selectable rows

Net spend by category

Tap a row to filter

Import

import { CategoryBreakdown } from '@connor-adams/designsystem'

Usage

A card that ranks money by category as horizontal bars — the "net spend by category" tile.

<CategoryBreakdown
  title="Net spend by category"
  subtitle="This month · transfers excluded"
  trend={[12, 9, 14, 11, 18, 16, 22]}
  rows={[
    { category: 'groceries', amount: -842 },
    { category: 'dining', amount: -586 },
    { category: 'transport', amount: -418 },
  ]}
/>
<CategoryBreakdown rows={rows} onSelect={(category) => filterBy(category)} />

Bars scale to the largest absolute amount (override with max). Pass trend for the header sparkline (trendTone defaults to negative). Pass onSelect to make each row a button. Amounts infer in/out sign, so it works for income too.

Props

PropTypeDefaultDescription
rows*CategoryBreakdownRow[]
titleReactNode
subtitleReactNode
trendnumber[] | undefined
trendTone"primary" | "positive" | "negative" | "neutral" | undefinednegative
maxnumber | undefined
currencystring | undefinedCAD
localestring | undefineden-CA
onSelect((category: string, row: CategoryBreakdownRow) => void) | undefined