High-performance NumberFlow component using Nitro modules for smooth, native animations.
- 🚀 Native Performance: 60+ FPS animations powered by native code
- 🎯 Zero JS Thread Blocking: All animations run on native threads
- 📱 Cross-Platform: Works on both iOS and Android
- 🎨 Customizable: Full styling and animation configuration support
- 🔢 Flexible Formatting: Support for compact notation, locales, and custom formatting
- ⚡ Bun Support: Built with Bun package manager for fast development
bun add react-native-nitro-numberflow
cd ios && pod installimport { NumberFlow } from 'react-native-nitro-numberflow'
export default function App() {
const [value, setValue] = useState(1234.56)
return (
<NumberFlow
value={value}
enableCompactNotation
showDollarSign
animationConfig={{
enabled: true,
mass: 0.8,
stiffness: 75,
damping: 15,
}}
textStyle={{
fontSize: 24,
fontWeight: 'bold',
color: '#000',
}}
/>
)
}| Implementation | 100,000 animations | Memory Usage | Frame Rate |
|---|---|---|---|
| JS Reanimated | 434.85ms | High | 30-45 FPS |
| Nitro Native | 7.27ms | Low | 60 FPS |
value: number- The numeric value to display and animateenableCompactNotation?: boolean- Use K/M/B/T notation for large numbersshowDollarSign?: boolean- Prefix with $ symbolshowPercentageSign?: boolean- Suffix with % symbolanimationConfig?: AnimationConfig- Configure spring animation parameterstextStyle?: TextStyle- Style the text component- And many more formatting options...
bun install
bun run specs # Generate Nitrogen bindings
bun run typescript # Compile TypeScriptThis Nitro module replaces heavy JavaScript-based animations with native implementations:
- iOS: Uses
CADisplayLinkandCATextLayerfor 60fps animations - Android: Uses
ChoreographerandValueAnimatorfor smooth animations - Shared C++: Common formatting and calculation logic
- Install the module in your React Native app
- Replace existing NumberFlow components with this Nitro version
- Configure animation settings to match your design requirements
- Test on both iOS and Android devices
The module is ready for production use and provides significant performance improvements over JavaScript-based implementations.