Skip to main content
Extensions can register custom screens that appear in Klyx’s navigation system. Screens are Jetpack Compose composables identified by a ScreenId. Navigation is handled through the Navigator service.

ScreenRegistry

Register screens during onLoad() and unregister them in onUnload(). Registration uses Kotlin context receivers — you do not pass the plugin instance explicitly.

Register a screen

The ScreenId is a value class wrapping a string. By convention, use reverse-DNS notation:

Unregister a screen

Set screen content

Replace an existing screen’s composable without unregistering:

Get screen content

Retrieve a registered screen’s composable:

Check ownership

Transient screens

setTransient registers short-lived content that shadows any previously registered screen for the same id. unregisterTransient removes it and restores the previous registration. The host auto-unregisters transient screens when their navigation entry is popped, so you normally don’t need to clean them up manually — see openScreen.
Use register for screens that should persist for the plugin’s lifetime, and setTransient for one-shot screens opened on demand. Use the Navigator service to navigate between destinations.
You can also use the convenience extension:

Open a screen with inline content

Open a screen directly from a composable, without pre-registering it. Because the content is a closure, it can capture any data the screen needs — a file, a URI, a result object — giving custom screens the same payload support that custom editor tabs have:
The screen is registered as a transient screen: the host auto-unregisters it when its navigation entry is popped, so no cleanup is required. openScreen also returns a ScreenRegistration if you want to remove it earlier:
This works from any plugin code — toolbar actions, settings, lifecycle methods. File runners use the same API via their FileRunnerContext.
A sealed class representing destinations within the app.

SpecialScreens

Pre-built ScreenId constants for core destinations:

API reference

ScreenId

Screen

ScreenRegistration

ScreenRegistry

LocalTabs

A CompositionLocal providing access to the Tabs service for managing workspace tabs.

Example

Register multiple screens during onLoad():
Each screen is a Composable function that receives the services it needs as parameters. Toolbar actions navigate to these screens: