Receipt match

Shows a file next to the item it belongs to, and whether they match.

Examples

Matched

Corner Market

Oct 2, Receipt matched

minus 41.20 US dollars

Expenses this week

Corner Market

Oct 2, Receipt matched

minus 41.20 US dollars

Harbor Cafe

Oct 3, Receipt says $16.50

minus 18.50 US dollars

Paper Lane

Oct 4, No receipt yet

minus 9.99 US dollars

State

  • Corner Market

    Oct 2, Receipt matched

    minus 41.20 US dollars

    matched

  • Corner Market

    Oct 2, Receipt says $44.20

    minus 41.20 US dollars

    review

  • Corner Market

    Oct 2, No receipt yet

    minus 41.20 US dollars

    missing

Usage

When to use it
Use
The assistant paired a receipt photo with a card payment.
Use
A list of payments that still need a receipt, for expenses or taxes.
Use
A receipt that does not agree with its payment and needs a look.
Not for
A payment with no receipt involved. Use List.
Not for
Uploading the receipt file itself. Use Dropzone.

Rules

6 rules
Must
Give a review match a note that says what differs. Because the default review note is "Check the receipt", which never says what to check.
Must
Pass onAdd with a missing match; the empty paper is the add button. Because without onAdd the paper is still a focusable button that does nothing.
Must
Pass the amount signed, negative for money out. Because Amount prints a positive value with no minus, so a payment reads as money in.
Should
Pass the receipt photo as src when you have it; the drawn paper is a stand-in.
Should
Stack matches with a 12px gap and no hairlines; the papers already set the rhythm.
Never
Wrap a match in a Card or a grey panel; it is a row. Because the paper thumbnail is already the frame, so a card puts a box around a box.

Accessibility

3 checks
The match is said in the note, not only by the mark.
The empty paper is a button named "Add a receipt for" and the merchant.
The drawn paper is decorative and hidden from screen readers.

Edge cases

3 edge cases
Long merchant name
Truncates with an ellipsis; the amount keeps its width.
Narrow screen
The note truncates; the paper stays 40 by 48.
Right to left
The paper sits at the start and its mark moves to the other corner.

API

7 props
merchant
string default required
date
string default required
amount
number default required
state
'matched' | 'review' | 'missing' default required
note
string default a word for the state
src
string
onAdd
() => void

Tokens

9 tokens
--raised
#ffffff
--line
#e6e4df
--surface-3
#e6e4df
--success-text
#17703a
--warn-text
#8a5200
--warn
#c27a00
--control
#85827a
--fg-3
#6b6a63
--radius-field
12px

Install

For your coding agent

GitHub

Please star me pookie

141

A new design system every week

Leave your email before you copy the prompt.