Skip to content

Releases: AmatoGiulio/react-native-numeric-text

v0.3.0 — shared values, textAlign, two-tone fraction

Choose a tag to compare

@AmatoGiulio AmatoGiulio released this 25 Aug 12:03

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 gated alignMode in the Android roll engine — center is byte-identical to before — and a SwiftUI .frame(alignment:) on iOS).
  • Completed two-tone fraction — the fractionColor fraction now rolls together with the rest of the digits on iOS, instead of cross-fading on its own. The colour lives inside a single AttributedString with no outer foregroundStyle, 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.md covering 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 the research/engine-derivation branch.

Fixes

  • CI: reconcile yarn.lock (react-native-reanimated 4.2.3) so yarn install --immutable passes again; all jobs green.

Full Changelog: v0.2.0...v0.3.0

v0.2.0 - Native currency & percent formatting

Choose a tag to compare

@AmatoGiulio AmatoGiulio released this 17 Aug 10:22

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 format prop shaped as a subset of Intl.NumberFormatOptions
  • Native currency formatting on iOS and Android
  • Native percent formatting
  • currency shorthand
  • currencyDisplay: '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