Jetpack Compose
The planned Android UI package, @bake-native/octane/ui/jetpack-compose, and what Android draws until it ships.
@bake-native/octane/ui/jetpack-compose is the Android package of Native UI. It follows @expo/ui/jetpack-compose, as @bake-native/octane/ui/swift-ui follows @expo/ui/swift-ui.
Coming soon (v0.2). The package does not exist yet. Nothing on this page works today except Until then.
| Package | Platforms | Status |
|---|---|---|
@bake-native/octane/ui (Universal) | iOS, macOS, Android, web, Windows | available (Universal UI) |
@bake-native/octane/ui/swift-ui | iOS, macOS | available |
@bake-native/octane/ui/jetpack-compose | Android | coming soon (v0.2) |
What is planned
- Host. A
Hostcomponent is the boundary. Jetpack Compose draws what is inside it, in theBakeNativeView. A screen can hold Universal and Compose hosts side by side. - Components and modifiers. Compose's names, as
@expo/ui/jetpack-composehas them, the way the SwiftUI package uses SwiftUI's names. - State is controlled from JS. A control shows the value you pass and reports a change through its callback, as in the other two packages.
- Fails closed off Android. A Compose component rendered on iOS, macOS or Windows is a build error, as a SwiftUI component on Android is today (
ui-swift-ui-target). - The first frame. A
Host's Compose tree is part of the baked first frame (--bake) and is adopted when JavaScript takes over. - Universal on Compose. Later, a Universal
Hoston Android renders through the same Compose host. Components outside aHostkeep drawing as elements. The choice is made onimport.meta.env.BAKE_TARGET, so the Android bundle carries only the Android implementation.
Until then
Write Android screens with the Universal package, @bake-native/octane/ui. One source then runs on every target.
On Android, Universal components draw as elements styled with CSS, the same elements as on the web and Windows. The Android host turns them into Android views. Switch and Checkbox are CSS boxes with an SVG check. Slider gets the platform's range control. Picker is a CSS field, and the menu it opens is the platform's.
Header and TabBar already draw natively on Android: a Material top bar and a Material 3 navigation bar.
Form elements outside @bake-native/octane/ui (<input>, <textarea>, <select>, <dialog>) are drawn by the host with Material 3 Compose and EditText. See Embed in an Android app.
SwiftUI components
Use the system's own UI from React or Octane - tab bars, navigation bars, sheets, Liquid Glass buttons and form controls - with @bake-native/react/ui/swift-ui.
Micro-native packages
Embed a React or Octane feature with its own bundle, baked first screen, typed modules and update contract.