AccountCard

Molecules

Feature-rich account card displaying account type, name, balance, trend indicator, and action buttons. Minimum 300x200px with elevation shadow and optional interactive states. Ideal for dashboard account overviews and financial summaries.

Examples

Checking Account

Basic checking account with positive balance.

Personal Checking

•••• 1234
$5,432.10

Available

Code:
<AccountCard
  accountType="checking"
  accountName="Personal Checking"
  balance={5432.10}
  accountNumber="1234"
/>

Savings with Upward Trend

Savings account showing positive growth trend.

Emergency Fund

•••• 5678
$12,500.00

Available

Code:
<AccountCard
  accountType="savings"
  accountName="Emergency Fund"
  balance={12500.00}
  accountNumber="5678"
  trend="up"
  trendValue="+2.5%"
  action={{
    label: 'Deposit',
    onClick: () => console.log('Deposit'),
    icon: 'add'
  }}
/>

Credit Card with Balance Due

Credit card showing negative balance (debt) with downward trend.

Platinum Card

•••• 9012
$1,234.56

Available

Code:
<AccountCard
  accountType="credit"
  accountName="Platinum Card"
  balance={-1234.56}
  accountNumber="9012"
  trend="down"
  trendValue="-15% from limit"
  action={{
    label: 'Pay Now',
    onClick: () => console.log('Pay'),
    variant: 'primary'
  }}
  secondaryAction={{
    label: 'View Transactions',
    onClick: () => console.log('View')
  }}
/>

Investment Account

Investment account with neutral trend and actions.

Growth Portfolio

$45,678.90

Available

Code:
<AccountCard
  accountType="investment"
  accountName="Growth Portfolio"
  balance={45678.90}
  trend="neutral"
  trendValue="0.0% today"
  action={{
    label: 'Trade',
    onClick: () => console.log('Trade'),
    variant: 'primary'
  }}
  secondaryAction={{
    label: 'Reports',
    onClick: () => console.log('Reports')
  }}
/>

Interactive Card

Clickable card with hover and focus states.

Business Checking

•••• 3456
$25,000.00

Available

Code:
<AccountCard
  accountType="checking"
  accountName="Business Checking"
  balance={25000.00}
  accountNumber="3456"
  trend="up"
  trendValue="+$1,250"
  onClick={() => alert('Card clicked - navigate to details')}
/>

Account Grid

Multiple account cards in a responsive grid layout.

Checking

$5,432.10

Available

Savings

$12,500.00

Available

Credit Card

$1,234.56

Available

Code:
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))', gap: '16px' }}>
  <AccountCard
    accountType="checking"
    accountName="Checking"
    balance={5432.10}
    trend="up"
    trendValue="+$150"
  />
  <AccountCard
    accountType="savings"
    accountName="Savings"
    balance={12500.00}
    trend="up"
    trendValue="+2.5%"
  />
  <AccountCard
    accountType="credit"
    accountName="Credit Card"
    balance={-1234.56}
    trend="down"
    trendValue="-15%"
  />
</div>

Props

PropTypeDefaultRequiredDescription
accountType'checking' | 'savings' | 'credit' | 'investment' | 'loan'RequiredType of account determining the icon displayed in the header
accountNamestringRequiredDisplay name of the account shown as h4 heading
balancenumberRequiredAccount balance displayed in large xlarge size with bold weight
accountNumberstringLast 4 digits of account number shown as •••• 1234 in subdued caption text
trend'up' | 'down' | 'neutral'Trend direction showing balance change with directional arrow icon
trendValuestringTrend value text (e.g., "+2.5%" or "$150") displayed with trend icon
action{ label: string; onClick: () => void; icon?: IconName; variant?: 'primary' | 'secondary' | 'naked' }Primary action button with label, click handler, optional icon and variant
secondaryAction{ label: string; onClick: () => void; icon?: IconName; variant?: 'primary' | 'secondary' | 'naked' }Secondary action button (defaults to naked variant) with label and click handler
currencystring'AUD'Currency code for balance display (passed to MoneyDisplay component)
onClick() => voidClick handler making entire card interactive with hover, active, and focus states
data-testidstringTest identifier. Propagates to balance and action buttons with suffixes.

Design Tokens Used

semantic.spacing.layout.lgsemantic.spacing.layout.mdsemantic.spacing.layout.smsemantic.spacing.layout.xssemantic.color.background.surfacesemantic.color.background.inversesemantic.color.border.defaultsemantic.border.radius.mdsemantic.color.icon.interactivesemantic.color.icon.inversesemantic.color.text.subduedsemantic.color.text.successsemantic.color.text.errorsemantic.typography.h4semantic.typography.caption

Accessibility

General Notes:

Uses role="article" for non-interactive cards and role="button" for clickable cardsKeyboard accessible with Tab, Enter, and Space key support for interactive cardsDescriptive aria-label on clickable cards includes account name and balanceAccount type icon has descriptive aria-labelTrend icon has descriptive aria-label indicating directionFocus visible outline with 2px border and offset meets WCAG 2.2 AAAction buttons maintain full keyboard and screen reader accessibilityCard elevation and hover states provide visual feedback for interactivityTrend colors (green/red) provide additional context but not sole indicator

Keyboard Navigation:

Tab: Focus card (if clickable) or actions | Enter/Space: Activate card onClick | Tab through action buttons

Screen Reader:

Announces account type, name, balance, optional account number, trend information, and available actions

Color Contrast:

All text and icons meet WCAG AA contrast (4.5:1). Trend colors provide context but text labels ensure clarity

Focus Management:

Interactive cards receive focus with visible outline. Action buttons maintain independent focus states.

Anatomy

Card container with header section, balance display, optional trend, and action buttons

Structure Diagram:


┌──────────────────────────────────────┐
│ Box (300x200 min)                    │
│ ┌──────────────────────────────────┐ │
│ │ StyledHeader                     │ │
│ │  ┌────┐  Account Name            │ │
│ │  │Icon│  •••• 1234               │ │
│ │  └────┘                          │ │
│ └──────────────────────────────────┘ │
│                                      │
│ ┌──────────────────────────────────┐ │
│ │ BalanceSection                   │ │
│ │  Balance (caption, subdued)      │ │
│ │  $12,345.67 (xlarge, bold)       │ │
│ │  ↑ +2.5% (xs icon + caption)     │ │
│ └──────────────────────────────────┘ │
│                                      │
│ ┌──────────────────────────────────┐ │
│ │ StyledActions                    │ │
│ │  [Primary Button] [Secondary]    │ │
│ └──────────────────────────────────┘ │
└──────────────────────────────────────┘
    

Component Parts:

Box (Card Container)Root Box component with min dimensions, padding, border, and shadow
semantic.spacing.layout.lgsemantic.color.background.surfacesemantic.color.border.default
StyledHeaderHeader section with flex layout containing icon and account name/number
semantic.spacing.layout.md
StyledIconWrapperIcon container with inverse background color, rounded corners, and fixed dimensions (40x40px)
semantic.color.background.inversesemantic.border.radius.mdsemantic.color.icon.interactive
Account Type IconMedium-sized icon indicating account type with inverse color
semantic.color.icon.inverse
Account NameH4 heading for account display name
semantic.typography.h4
Account NumberOptional last 4 digits in subdued caption text with bullet prefix
semantic.typography.captionsemantic.color.text.subdued
StyledBalanceSectionBalance display area with label, amount, and optional trend
semantic.spacing.layout.lg
Balance LabelCaption text reading "Balance" in subdued color
semantic.typography.captionsemantic.color.text.subdued
MoneyDisplayLarge balance display (xlarge size, bold weight) with currency formatting
StyledTrendSectionTrend indicator with directional icon and value text
semantic.spacing.layout.xssemantic.spacing.layout.sm
Trend IconSmall directional arrow (up/down/right) with semantic color
semantic.color.text.successsemantic.color.text.errorsemantic.color.text.subdued
Trend ValueCaption text showing trend percentage or amount with matching color
semantic.typography.caption
StyledActionsAction button container with flex layout and equal-width buttons
semantic.spacing.layout.sm

Additional Notes

Composes from Stack, Box, Icon, Typography, MoneyDisplay, and Button atomsMinimum dimensions 300x200px ensure consistent card sizes in gridsElevation shadow provides depth and hierarchyInteractive cards have enhanced hover shadow and slight lift transformAccount type icons use placeholder icons until custom financial icons addedTrend indicators use directional arrows with semantic colors (green=up, red=down, gray=neutral)Action buttons expand to fill available width with equal distributionPrimary action defaults to primary variant, secondary to naked variantBalance displayed in xlarge bold for prominent visibilityAccount number masked with bullets (••••) for security indicationWorks in grid layouts with responsive wrappingdata-testid propagates to balance and action buttons for testing