Skip to main content

panelAvailability

Whether the session has panels to show.

Overview​

panelAvailability on the session emits whether the current page config has panels, for example to hide your own "open panel" entry point when there are none.

Syntax​

val panelAvailability: StateFlow<PanelAvailability>

sealed interface PanelAvailability {
data object Loading : PanelAvailability
data object None : PanelAvailability
data class Available(val panelIds: List<String>) : PanelAvailability
}

Values​

ValueDescription
LoadingThe page config hasn't loaded yet
NoneThe page config has no panels to show
Available(panelIds)The panels to show, as config panel ids in tab order

Example​

val availability by sdk.panelAvailability.collectAsStateWithLifecycle()
OpenPanelButton(visible = availability is PanelAvailability.Available)