Skip to main content

MoneyDisplay

BasicClinical values<co-money-display>

MoneyDisplay shows US dollar amounts with two decimals, grouping and tabular figures, and negative adjustments in parentheses.

import { MoneyDisplay } from 'health-components';

Examples​

Statement​

Storybook

Balance Due​

Storybook

Usage​

<MoneyDisplay value={-45} label="contractual adjustment" />

When to use​

  • Charges, payments, adjustments, balances, copays, estimates.

When not to use​

  • Counts or units of service: plain numbers.

Variants and states​

VariantWhat it is
positive$1,234.50.
negative($45.00), read as "minus $45.00".
zero$0.00.
missingEn dash when there is no amount.
emphasisBold, for balance due.
align endRight aligned for columns.

Accessibility​

  • aria-label says "minus" for negatives; parentheses are not read reliably.

Do and don't​

  • Do: Right-align money columns.
  • Don't: Use red alone for negatives.

Props​

PropTypeDefaultDescription
value *number | null—Amount in US dollars; null shows an en dash (no amount); required
emphasisbooleanfalseBold, for balance due
align'start' | 'end''start''start' | 'end' (right aligned for columns)
labelstringnoneAppended to the spoken text ('contractual adjustment')
minWidthnumber90Column width in px when `align` is 'end'

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-money-display>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-money-display value="…" emphasis [defaultValue]="defaultValue"></co-money-display>
KindNameDescription
attributevalueAmount in US dollars; null shows an en dash (no amount); required
attributeemphasisBold, for balance due; default false
attributealign'start' | 'end' (right aligned for columns); default 'start'
attributelabelAppended to the spoken text ('contractual adjustment'); default none
attributemin-width / minWidthColumn width in px when `align` is 'end'; default 90
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus