RateLine
A rate with its timestamp. Never one without the other.
npx shadcn add @lopifi/rate-lineExamples
The same component, case by case. Each stage is the shipped code with the props it shows; switch to Code for the usage.
Inverted polarity
To a US importer paying in euros, a rising EUR/USD is bad news, so the tint reads negative.
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.
<RateLine from="USD" to="EUR" rate={0.91842} asOf={t} />
// 1 USD = 0.91842 EUR · 12s ago
5 significant figures, tnum. The timestamp is not optional. The component has no variant without it.
Live variant flashes on update (value flash), throttled to one flash per 400ms.
The accounting it encodes
The concepts this component renders, each defined once in the lexicon.
More in Swaps & FX
See also
Where this component is specified, defined and running.
Elsewhere in the system
The live section RateLine renders in, the calculators behind its figures, and the ledger payloads that feed it.
- RateLine, runningThe swaps showcase — live, with theme, density, grayscale and reduced-motion switches.
- Effective vs nominal rateTurn a nominal rate into the effective annual rate it compounds to.
- Swaps & FXThe rule for this family: A rate is a perishable fact. It never appears without a timestamp, and it is never transacted on without a lock. Specs for 9 React components: SwapWidget, RateLine, RateLock, ConversionBreakdown and 5 more.
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 Swaps & FX changes
Your copy doesn’t update itself when we fix something here.
- One email when a Swaps & FX component needs a migration
- Nothing when nothing changes
Or install it now