Repository navigation
nitro-input v0.3.1
·
31 commits
to main
since this release
- Signs:
signDisplay('auto','always','exceptZero',
'negative','never', asIntl.NumberFormat's) puts a plus on gains,
and a plus that turns into a minus swaps like any other glyph;plusSign
andminusSignset the glyphs. Aformatgives its sign display and its
locale's minus. - Styled parts:
prefixColor,suffixColor, andfractionFontSize,
fractionColorandfractionAlignfor smaller, dimmer or superscript
cents. onAnimationStart/onAnimationEnd: when the figure sets off from
rest and when it comes to rest, once for a run of changes.NitroTime: seconds as a clock, timer or countdown (m:ss,
h:mm:ss…), its tens of seconds and minutes wrapping after 5 so 0:59 →
1:00 turns them one step. Built ondigits(the highest digit a position
shows before it wraps, as NumberFlow's) andgroupingSizes, both open to
any figure.- Compact figures: a compact
formatrolls the figure it shows and swaps
its suffix ("950" → "1.5K" → "2.3M"). continuous: the wheels below the highest one that changes turn a full
turn too, so a roll seems to pass through every value between.- Native digits and grouping:
digitGlyphsandgroupingSizes, or a
format's numbering system and group sizes (ar-EG's ٠١٢٣…,en-IN's
12,34,567). animated={false}shows every change at once, and
respectReduceMotion={false}animates under Reduce Motion.NitroText: a single line of text that morphs natively, shared
characters gliding to their new places ("Sign in" → "Signing in…",
"$1,204" → "$1,318"), as Torph does on the web. Its own native view: one
draw of cached glyphs at rest like a label, sized by a synchronous native
measurement in the render that mounts it, with the loading shimmer and its
options. Only the props you set cross to native, a static label never
touches the reflow engine, and a reused view keeps its drawn line: 1000
labels mount in 113 ms of main thread on an iPhone 11 Pro and 510 ms on a
Galaxy A22 (Text: 140 and 790,react-native-plain-text: 112 and 620).- Shimmer options:
shimmerAngle,shimmerWidth,shimmerBaseColor
(a skeleton),shimmerDirection(following the layout direction by
default, so a right-to-left layout now sweeps right to left) and
shimmerDelay. - Fixed: on iOS the loading glint was drawn in the label colour (black
on dark text, so invisible) unlessshimmerColorwas given; it uses the
documented light neutral now. - Fixed:
NumberFormatwithnotation: 'compact'dropped the currency and
the percent sign ("950" for "$950"; Android printed a compact currency in
full) and signDisplay's plus. It prints them as V8 does now. - Android:
NitroTextcrosses JNI to the reflow engine once per text
change and once per frame, rather than once per character and several
times a frame.