Methods for interacting with bottom navigation bar

🚨 Please note: these methods are only for use in eitri-apps running in a EitriBottomTabView.

Hierarchy

  • BottomBar

Methods

  • Show the BottomBar

    Example:

    await Eitri.bottomBar.show()
    

    Compatibility Control

    • API LEVEL 18 - Functionality added

    Returns Promise<void>

  • Hide the BottomBar

    Example:

    await Eitri.bottomBar.hide()
    

    Compatibility Control

    • API LEVEL 18 - Functionality added

    Returns Promise<void>

  • Change the active tab in BottomBar

    Example:

    await Eitri.bottomBar.changeTab({index: 2})
    

    Compatibility Control

    • API LEVEL 20 - Functionality added

    Parameters

    Returns Promise<void>

  • Updates a badge to a tab's icon in the BottomBar.

    Passing null or undefined as the tab content will remove the badge.

    Example:

    await Eitri.bottomBar.updateTabBadge({index: 1, content: '3'})
    await Eitri.bottomBar.updateTabBadge({index: 1, content: null})

    Compatibility Control

    • API LEVEL 29 - Functionality added

    Parameters

    Returns Promise<void>

  • Returns a snapshot of the BottomBar's current state — the list of tabs and the currently selected index. The active tab is result.tabs[result.selectedIndex].

    Returns null when called from an eitri-app that is not running inside a EitriBottomTabView.

    slug and version on each tab are only populated when the tab's kind is "eitriApp" and the underlying machine has already been instantiated.

    Example:

    const state = await Eitri.bottomBar.getState()
    if (state) {
    const current = state.tabs[state.selectedIndex]
    if (current.kind === "eitriApp") {
    console.log(current.slug)
    }
    }

    Compatibility Control

    • API LEVEL 36 - Functionality added

    Returns Promise<null | BottomBarStateOutput>

Generated using TypeDoc