Installation
bun add nitro-ui-sketch
bun run nitro-ui prepare
The NitroUI CLI finds the package through its nitro.json, generates its bindings with the app's Nitrogen, links its Swift package into the iOS build, and links its C++ and Kotlin sources into the Android runtime library.
The package ships no generated code. nitro-ui prepare writes it to node_modules/nitro-ui-sketch/nitrogen/generated and runs again whenever the package changes.
:::warning List it in the app's own dependencies
The NitroUI CLI only looks at the app's own dependencies. If nitro-ui-sketch is only a dependency of another package, the CLI never generates or links it. Add it to the app's package.json directly.
:::
Peer dependencies
| Package | Version |
|---|---|
nitro-ui-renderer | >=0.3.0 |
react | >=19.2.0 |
Pinning nitro-core
The package depends on nitro-core 1.0.0-alpha.nightly.137.gd4793c40b8b8 exactly, the version NitroUI 0.3.0 pins. The NitroUI CLI requires every module to resolve the same nitro-core as the SDK.
If your app is on a NitroUI release that pins another version, override nitro-core and nitrogen in the app's package.json to match this package:
{
"overrides": {
"nitro-core": "1.0.0-alpha.nightly.137.gd4793c40b8b8",
"nitrogen": "1.0.0-alpha.nightly.137.gd4793c40b8b8"
}
}
Install size
The prebuilt tgfx libraries ship inside the package (vendor/tgfx), so the install is about 260 MB. Most of it never reaches the app:
- The iOS simulator slice only goes into simulator builds.
- Android loads one ABI per device, and an App Bundle delivers only that one.
- The linker keeps only the tgfx code the canvas calls.
In a debug arm64-v8a build of the example app, tgfx and the ink engine add about 2 MB of native code.
Platforms
| Platform | Renderer | Minimum |
|---|---|---|
| iOS | Metal | iOS 16 (from the package's Package.swift) |
| Android | OpenGL ES | What your NitroUI release requires |
Next: the quick start.