Delegates creation, placement, and removal to the enclosing scene's platform. The default backend creates a child volumetric window anchored to the activity's main window. Other SDK-provided backends can represent the window using their native scene primitives.
On platforms with finite window capacity, priority decides who gets the slots (higher wins; ties first-come-first-served). fallbackStrategy decides what a window renders while it has no slot, and promotable decides whether it keeps waiting for one or renders that fallback without attempting placement. Observe
WindowState.lifecycle on the windowState holder to react to placement and failures.
Window identity is keyed by key: the same key across recompositions reuses the same underlying window (changes to modifier are applied as a relayout). A new key creates a new window; a previously-emitted key that disappears removes its window. Wrap conditional emissions in if/when and Compose's normal lifecycle handles add/remove for you.
key: String
Unique, stable identifier for this window. Must be unique across all simultaneously emitted
SpatialWindows in the scene; should be stable across recompositions to preserve window identity.
modifier: WindowModifier
Spatial configuration chain — size, anchor, offset. Changes to a chain entry trigger a relayout of the window; they do not recreate it. See
WindowModifier.
windowState: WindowState
State holder for observing the window's
WindowLifecycle. Defaults to a fresh
rememberWindowState scoped to this call site. If supplied explicitly, remember or hoist it; replacing the state recreates the hosted window even when key is unchanged.
promotable: Boolean
Whether to keep trying to place the window as a child window, or render its fallbackStrategy without attempting placement.
priority: Int
Slot-allocation priority; higher wins, ties broken first-come-first-served. While every window in the scene is at 0, capacity is platform-governed; setting a non-zero priority anywhere makes the SDK place higher-priority windows first and preempt lower-priority ones when the scene is full.
content: @Composable () -> Unit
Composable rendered inside the window when placed, or inline at this call site under
WindowFallback.Inline. Runs in its own composition (independent lifecycle and view-tree owners) when placed as a window. Under
WindowFallback.Drop, it is not composed until the window is placed; under
WindowFallback.Inline, it is composed at the call site while it waits. Apply
Modifier.fillMaxSize to fill the window.