availablePanels
Emits the panels available for the current event in tab order.
Overview
Use availablePanels to drive player-side controls — such as buttons that navigate directly to a
specific panel — that should only appear when the current event actually supports that panel. The
flow follows event and config changes automatically: as the event or user configuration updates,
the emitted value reflects the new set of available panels.
Available panels are already narrowed by UserConfig.enabledPanels, so the list reflects only
panels your configuration allows in addition to those the event supports.
Syntax
val availablePanels: Flow<MaestroPanelAvailability>
Returns
A Flow that emits MaestroPanelAvailability values:
| State | Meaning |
|---|---|
Loading | Config has not yet resolved. Render a loading or hidden state for any panel-specific controls. |
None | The current event has no panels for this platform. Hide panel-specific controls. |
Available(panels) | The list of available MaestroPanelType values, in the order the SDK's own tab bar displays them. |
Example
import com.lessthan3.maestropanel.ui.topheader.MaestroPanelAvailability
import com.lessthan3.maestropanel.ui.topheader.MaestroPanelType
// Collect available panels and show a Stats button only when Stats is available
val availability by sdk.availablePanels.collectAsState(MaestroPanelAvailability.Loading)
val panels = (availability as? MaestroPanelAvailability.Available)?.panels.orEmpty()
if (MaestroPanelType.EspnStats in panels) {
StatsButton(onClick = { sdk.didShowPanel(MaestroPanelType.EspnStats) })
}
Notes
- Collect with an initial value of
MaestroPanelAvailability.Loadingto avoid showing stale state before the first emission. - Use
selectedPanelto track which tab the SDK currently shows; combine withavailablePanelsto highlight the active button. - Call
didShowPanel()to navigate to a specific panel. A call issued before config resolves is queued and applied once the panel is ready.