s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All UI components

Display and status

CurrencyDisplay

CurrencyDisplay - Formats and displays monetary values Displays formatted currency with configurable unit. Use `unit="cents"` (default) when amount is in the currency's minor units, or `unit="dollars"` when it is already in major units. Accepts ISO 4217 currency codes, normalized by trimming whitespace and uppercasing before locale formatting. Unsupported codes render an accessible inline error instead of throwing during a collection render.

Public export

typescript
import { CurrencyDisplay } from '@happyvertical/smrt-ui';
Import path
@happyvertical/smrt-ui
Props
8
Props described
8 of 8
Bindable state
0
Callback events
0
Verified release
0.44.0

Props

NameTypeRequiredDescription
amountnumberYesAmount value
currencystringNoISO 4217 currency code. Whitespace is trimmed and letters are uppercased.
unit'cents' | 'dollars'NoWhether amount is a safe integer of ISO minor units or a major-unit number
showSignbooleanNoShow +/- sign for non-zero values
size'sm' | 'md' | 'lg'NoDisplay size
highlightNegativebooleanNoHighlight negative values in red
highlightPositivebooleanNoHighlight positive values in green
classstringNoOptional CSS class

Bindable state

This component has no bindable public state.

Callback events

This component declares no callback event props.

Examples and explanation