API reference

SpatialScene Composable

Top-level composable hosting a Spatial Window scene — the SDK's scene entry point. Call it from inside your activity's setContent { … } block; it composes like any other composable, so the scene can sit alongside arbitrary non-SDK Compose UI in the same activity.
content is a plain @Composable lambda — there is no builder receiver. Whatever you compose at the top level of the lambda is the activity's main-window content. Mix SpatialWindow calls freely with regular Compose UI; conditional emissions (if/when) and state-driven recomposition work the way you expect.
theme is applied exactly once around every part of the scene. The SDK wraps it around the main content, and — because a placed window's content runs in its own composition rooted at a separate Android context that does not inherit the scene — re-applies it inside each window. An inline fallback renders at its call site, already inside the main wrap. Provide your design system (composition locals, MaterialTheme, …) here; do not also wrap it around the content yourself.
The scene uses Meta Horizon OS volumetric windows by default. On an unsupported device — a phone, a HorizonOS build below the SDK's minimum supported version, an app not granted the volumetric-window permission, or an activity with no window token — the scene runs in compatibility mode: content renders as the activity's normal Compose content and every SpatialWindow falls back per its fallbackStrategy (no platform window is created).
configure opts the scene into additional capabilities by declaring the SDK's scene configuration extensions on its SceneConfigScope receiver (e.g. FocusMode()); it defaults to none. The block is composable, so configuration can react to state. A feature's composition locals reach both the main content and each window.
Usage:
class MyActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            SpatialScene {
                // Anything you compose at the top level here renders into the main window.
                MainUI()
                // SpatialWindow emits a child window beside the main window.
                if (showNav) {
                    SpatialWindow(key = "nav", modifier = WindowModifier.size(96.dp, 400.dp)) {
                        NavUI()
                    }
                }
            }
        }
    }
}

Signature

@Composable
fun SpatialScene(
    theme: @Composable (@Composable () -> Unit) -> Unit = { it() },
    configure: @Composable SceneConfigScope.() -> Unit = {},
    content: @Composable () -> Unit,
)

Parameters

theme: @Composable (@Composable () -> Unit) -> Unit
configure: @Composable SceneConfigScope.() -> Unit
content: @Composable () -> Unit