Repository navigation
Releases: AmatoGiulio/react-native-numeric-text
Release list
v0.3.0 — shared values, textAlign, two-tone fraction
Features
- Reanimated shared value as
value— drive the number straight from the UI thread (a gesture, a spring, a timing) with no React re-render.react-native-reanimated(>= 3) is an optional peer dependency, loaded only when a shared value is actually passed. textAlign(left/center/right) — pin the number to an edge so it stays fixed for the whole transition, incoming and outgoing, instead of always growing about its centre. Native on both platforms (a gatedalignModein the Android roll engine —centeris byte-identical to before — and a SwiftUI.frame(alignment:)on iOS).- Completed two-tone fraction — the
fractionColorfraction now rolls together with the rest of the digits on iOS, instead of cross-fading on its own. The colour lives inside a singleAttributedStringwith no outerforegroundStyle, so.numericText()sees one text run; the original SwiftUI view and its behaviour are untouched.
Docs
- Rewritten, production-grade README and a new
docs/ARCHITECTURE.mdcovering the renderer design and the transition model measured against SwiftUI. The full engine derivation — ground-truth recordings, measurement scripts, and the iteration log — is archived on theresearch/engine-derivationbranch.
Fixes
- CI: reconcile
yarn.lock(react-native-reanimated 4.2.3) soyarn install --immutablepasses again; all jobs green.
Full Changelog: v0.2.0...v0.3.0
v0.2.0 - Native currency & percent formatting
What's new
v0.2.0 expands NumericText beyond plain numbers with native, locale-aware currency and percent formatting while keeping formatting part of the transition itself.
Formatting
- New
formatprop shaped as a subset ofIntl.NumberFormatOptions - Native currency formatting on iOS and Android
- Native percent formatting
currencyshorthandcurrencyDisplay: 'symbol' | 'code'- Accounting-style negative currency values
- Configurable grouping, integer padding, fraction digits, and significant digits
- Consistent half-away-from-zero rounding across iOS, Android, and web
- Format-only changes can animate even when the numeric value stays the same
Android transition work
Currency symbols, ISO codes, percent signs, accounting brackets, and locale-specific affixes now participate structurally in the transition instead of being treated as static text.
This release also includes fixes for:
- bidi / RTL currency layouts
- rapid format retargeting and reversals
- repeated same-glyph sign transitions
- outgoing glyph clipping during shrinking format changes
- structural affix identity across grouping changes
The existing first-release motion constants were not retuned.
Accessibility
Standard React Native accessibility props are now forwarded through NumericText, while Android preserves the formatted value as the default accessibility description without overriding an explicit accessibilityLabel.
Validation
The formatting transition work was validated against the SwiftUI .numericText() ground truth using a deterministic 29-step currency/format sequence covering USD, EUR, PAB, AED RTL, accounting, percent, JPY, and BHD.
The release gate also passes library, web, Android and iOS builds, lint, typecheck, and unit tests.
Credits
Currency and percent formatting originated from a contribution by @Amanfromearth in #4.
The original API direction was retained and then validated and extended against the SwiftUI ground truth before landing in the final implementation.
currencyDisplay: 'name' and trailingDecimalSeparator remain intentionally deferred for a future release.
Full diff: v0.1.0...v0.2.0