Skip to content

LocalVanillaScreen

val LocalVanillaScreen: ProvidableCompositionLocal<Screen>

Provides the hosting vanilla Screen, regardless of whether it's a ComposeScreen or a ComposeContainerScreen - unlike LocalScreen/LocalContainerScreen, which are mutually exclusive depending on the screen type, this is provided by both.

Screen.setFocused/getFocused/clearFocus are all public vanilla API (unlike setInitialFocus/changeFocus, which are protected), so composables that need to register or release vanilla keyboard/controller focus explicitly - e.g. a pointer-driven text field syncing its local focus state back to vanilla, so Tab navigation and a modal opening over it both stay consistent with what's actually focused - can reach them through this without needing a reference to the concrete screen subclass.