Bottom Navigation

Bottom navigation can have up to 5 tabs with one active tab. You can optionally add a badge to one of the tabs.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

Bottom Navigation Preview

Usage

import id.co.biofarma.binduiandroid.components.bottom_navigation.BottomNavigation
fun BottomNavigationScreen() {
    var selectedTab by remember { mutableStateOf(0) }
    val tabs = listOf(
        "Home" to BottomNavigationMenuObj(icon = Icons.Outlined.Home),
        "Search" to BottomNavigationMenuObj(icon = Icons.Outlined.Search),
        "Like" to BottomNavigationMenuObj(icon = Icons.Outlined.Like),
        "Chat" to BottomNavigationMenuObj(
            icon = Icons.Outlined.Chat,
            notificationCount = 99,
        ),
        "Acocunt" to BottomNavigationMenuObj(
            icon = Icons.Outlined.User),
            notificationCount = 2,
            type = BottomNavigationMenuObjType.NUMBER
    )
    Row(
        modifier = Modifier
            .fillMaxWidth()
            .fillMaxHeight(),
        verticalAlignment = Alignment.Bottom
    ) {
        BottomNavigation(
            items = tabs,
            activeTab = selectedTab,
            onTabSelected = { selectedTab = it }
        )
 
    }
}

Examples

Items

Use items to set the number of menus displayed with a minimum of 2 items to a maximum of 5 items.

Bottom Navigation Example Items


No Labels

Use the empty string “ ” if items are created without labels.

Bottom Navigation Example No Labels


Props

PropsRequiredDefaultTypedescription
itemsfalse-List<Pair<String, BottomNavigationMenuObj>>A list of items containing menus and labels for bottom navigation.
activeTabfalse-intThe value with the active menu tab item.
onTabSelectedfalse-(Int) -> UnitA callback function to be executed when a menu item is clicked and becomes active.
BIND © Biofarma Innovate Next-level Design .