Components/Transaction Card

Transaction Card

A single financial transaction line item — merchant, amount, type, and category. Designed to stack vertically to form a ledger, wallet history, or payments inbox.


Spotify Premium

Music
Subscription2 hours ago
$9.99

Installation

npx ajaxui add transaction-card

Types

type drives both the amount sign and the color. Pending and failed states surface inline next to the date.

Salary

Income
ACME CorpToday 09:01
$4,200.00

Whole Foods

Food
GroceriesYesterday
$67.43

Uber

Transit
Ride to SFOA few min ago• pending
$42.10

Failed transfer

Transfer
To savings3 days ago• failed
$500.00

Composition as a list

Stack with a divider parent for a clean ledger look. The card has no outer margin — it adapts to whatever container drives the spacing.

Apple

Hardware
Mar 12
$1,299.00

Refund

Refund
Mar 11
$24.00

Netflix

Streaming
Mar 10
$15.49

Props

PropTypeDefaultDescription
titlestringMerchant or transaction name.
subtitlestringSecondary descriptor (e.g. "Subscription").
amountnumberAbsolute amount; sign is derived from type.
currencystring"USD"ISO 4217 currency code for Intl formatting.
type"credit" | "debit" | "pending" | "failed""debit"Drives color, sign, and inline status text.
dateDate | stringPre-formatted string or Date (formatted via Intl).
localestring"en-US"Locale used for Intl date + currency formatting.
categorystringSmall uppercase chip next to the title.
iconReactNodeLeading icon — defaults to a merchant glyph.
onClick() => voidWhen present, the card becomes a button.
hrefstringWhen present, the card becomes a link.

Accessibility

  • The amount is announced with the currency name expanded by Intl.NumberFormat (e.g. "negative nine dollars and ninety-nine cents").
  • If onClick or href is set, the root becomes a focusable button/a with a focus ring.
  • Status colors are paired with explicit text (pending, failed) to avoid color-only meaning.