CurrencyBadge
ISO code + optional flag.
npx shadcn add @lopifi/currency-badgeExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Mixed-currency balances
In a list of wallets the badge names each currency once, and each amount keeps its own decimals.
No flag for shared currencies
A currency used across several countries gets no flag rather than a wrong one — the code is always the fact.
How it behaves
What it renders, what it refuses to render, and why. The same paragraphs as the family spec, so the two can’t disagree.
ISO code, optionally with a flag. Flags are regional, not linguistic: EUR gets the EU flag, and a currency without a clean single-country mapping gets no flag instead of a wrong one. The code is always shown; the flag is decoration.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Primitives
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section CurrencyBadge renders in, the calculators behind its figures, and the ledger payloads that feed it.
- CurrencyBadge, runningThe primitives showcase — live, with theme, density, grayscale and reduced-motion switches.
- PrimitivesBuild these first. Everything above them inherits their mistakes. Specs for 16 React components: Money, Delta, Figure, Percent and 12 more.
- Currency decimal placesHow many decimals each ISO 4217 code is stored at, and where Intl disagrees.
Components are copied into your repository and meant to be edited. Rounding policy, fiscal calendar and compliance copy differ per company.
Release notes
Get an email when Primitives changes
Your copy doesn’t update itself when we fix something here.
- One email when a Primitives component needs a migration
- Nothing when nothing changes
Or install it now