BakeNative is under active development. APIs may change.
Skip to Content
BakeNative

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.

PackagePlatformsStatus
@bake-native/octane/ui (Universal)iOS, macOS, Android, web, Windowsavailable (Universal UI)
@bake-native/octane/ui/swift-uiiOS, macOSavailable
@bake-native/octane/ui/jetpack-composeAndroidcoming soon (v0.2)

What is planned

  • Host. A Host component is the boundary. Jetpack Compose draws what is inside it, in the BakeNativeView. A screen can hold Universal and Compose hosts side by side.
  • Components and modifiers. Compose's names, as @expo/ui/jetpack-compose has 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 Host on Android renders through the same Compose host. Components outside a Host keep drawing as elements. The choice is made on import.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.

On this page