mrousavy/nitro

πŸ”₯ Insanely fast native C++, Swift or Kotlin modules with a statically compiled binding layer to JSI

1,932

stars

1,968

commits

C++

primary language

Sep 10, 2026

updated

nitro.margelo.com
cpp
fast
hybrid
hybrid-object
jsi
kotlin
library
modules
native
nitro
nitro-modules
react
react-native
swift
templates
turbomodules

README

Nitro Modules

Nitro Modules are fast, type-safe native modules for React Native with statically compiled bindings to JSI. They consist of two parts:

Example

Declaration (TypeScript):

export interface Math extends HybridObject<{ ios: 'c++' }> {
  add(a: number, b: number): number
}

Implementation (C++, Swift or Kotlin):

class HybridMath: public HybridMathSpec {
public:
  HybridMath(): HybridObject(TAG) {}
  double add(double a, double b) override {
    return a + b;
  }
}

Usage (TypeScript):

import { NitroModules } from 'react-native-nitro-modules'

const math = NitroModules.createHybridObject<Math>('Math')
const result = math.add(5, 3)

Installation

Install react-native-nitro-modules from npm:

npm i react-native-nitro-modules
cd ios && pod install

Documentation

Supported Platforms

Cross-platform

Cross-platform native modules can be built with C++. Any custom C++ types can be used and bridged to JS with minimal overhead.

JS <-> C++ type converters are statically generated ahead of time - no more dynamic lookups or runtime parser errors! πŸ₯³

iOS

iOS native modules and view components can be written either in pure C++, or pure Swift. Thanks to Swift 5.9, Swift Nitro Modules bridge directly to C++ instead of going through Objective-C message sends. Woohoo, no more Objective-C, and zero overhead C++ -> Swift calls! πŸ₯³

Android

Android native modules and view components can be written either in pure C++, or pure Kotlin/Java. Thanks to fbjni, even complex types can be effortlessly bridged to Kotlin/Java with minimal overhead! πŸ”₯

Margelo

Nitro is built with ❀️ by Margelo. We build fast and beautiful apps. Contact us at margelo.com for consultancy services.

Contributing

Read CONTRIBUTING.md for the contribution flow (PR expectations, the required test-per-fix rule, and the nitrogen workflow). For environment setup and reproduction walkthroughs, see the contributing guide on the docs site.

License

MIT

Contributors

(top 30 of 47)

mrousavy

1,734 commits

dependabot[bot]

121 commits

riteshshukla04

19 commits

patrickkabwe

13 commits

mrousavy/nitro

πŸ”₯ Insanely fast native C++, Swift or Kotlin modules with a statically compiled binding layer to JSI

1,932

stars

1,968

commits

C++

primary language

Sep 10, 2026

updated

nitro.margelo.com
cpp
fast
hybrid
hybrid-object
jsi
kotlin
library
modules
native
nitro
nitro-modules
react
react-native
swift
templates
turbomodules

README

Nitro Modules

Nitro Modules are fast, type-safe native modules for React Native with statically compiled bindings to JSI. They consist of two parts:

Example

Declaration (TypeScript):

export interface Math extends HybridObject<{ ios: 'c++' }> {
  add(a: number, b: number): number
}

Implementation (C++, Swift or Kotlin):

class HybridMath: public HybridMathSpec {
public:
  HybridMath(): HybridObject(TAG) {}
  double add(double a, double b) override {
    return a + b;
  }
}

Usage (TypeScript):

import { NitroModules } from 'react-native-nitro-modules'

const math = NitroModules.createHybridObject<Math>('Math')
const result = math.add(5, 3)

Installation

Install react-native-nitro-modules from npm:

npm i react-native-nitro-modules
cd ios && pod install

Documentation

Supported Platforms

Cross-platform

Cross-platform native modules can be built with C++. Any custom C++ types can be used and bridged to JS with minimal overhead.

JS <-> C++ type converters are statically generated ahead of time - no more dynamic lookups or runtime parser errors! πŸ₯³

iOS

iOS native modules and view components can be written either in pure C++, or pure Swift. Thanks to Swift 5.9, Swift Nitro Modules bridge directly to C++ instead of going through Objective-C message sends. Woohoo, no more Objective-C, and zero overhead C++ -> Swift calls! πŸ₯³

Android

Android native modules and view components can be written either in pure C++, or pure Kotlin/Java. Thanks to fbjni, even complex types can be effortlessly bridged to Kotlin/Java with minimal overhead! πŸ”₯

Margelo

Nitro is built with ❀️ by Margelo. We build fast and beautiful apps. Contact us at margelo.com for consultancy services.

Contributing

Read CONTRIBUTING.md for the contribution flow (PR expectations, the required test-per-fix rule, and the nitrogen workflow). For environment setup and reproduction walkthroughs, see the contributing guide on the docs site.

License

MIT

Contributors

(top 30 of 47)

mrousavy

1,734 commits

dependabot[bot]

121 commits

riteshshukla04

19 commits

patrickkabwe

13 commits

Languages

C++

43.9%

TypeScript

33.3%

Swift

13.2%

Kotlin

7.4%