Skip to content

Latest commit

 

History

History
106 lines (79 loc) · 3.83 KB

TabSelector.md

File metadata and controls

106 lines (79 loc) · 3.83 KB

TabSelector

Custom tab selector to select the tab to display

Usage

class TestScreen : EquinoxScreen<EquinoxViewModel>() {

    @Composable
    @OptIn(ExperimentalComposeUiApi::class)
    override fun ArrangeScreenContent() {
        Column(
            modifier = Modifier
                .fillMaxSize(),
            horizontalAlignment = Alignment.CenterHorizontally,
            verticalArrangement = Arrangement.Center
        ) {

            // define your tabs
            val tabs = listOf(
                TabDetails(
                    icon = Icons.Default.Home,
                    tabTitle = "Home"
                ),
                TabDetails(
                    icon = Icons.Default.Info,
                    tabTitle = "About"
                ),
                TabDetails(
                    icon = Icons.Default.Contacts,
                    tabTitle = "Contacts"
                )
            )

            // create the related state
            val state = rememberTabSelectorState(
                initialTabIndex = 0 // the default index value
            )

            // create the selector
            TabSelector(
                state = state,
                tabs = tabs
            ) { tab, index ->

                // the content of each tab
                Column(
                    modifier = Modifier
                        .fillMaxSize(),
                    horizontalAlignment = Alignment.CenterHorizontally,
                    verticalArrangement = Arrangement.Center
                ) {
                    Text(
                        text = tab.tabTitle
                    )
                }
            }
        }
    }

}

Appearance

Mobile

tabselector-adnroid.mp4

Desktop & Web

tabselector-desktop.mp4

Support

If you need help using the library or encounter any problems or bugs, please contact us via the following links:

Thank you for your help!

Badges

Twitter

Donations

If you want support project and developer

Crypto Address Network
3H3jyCzcRmnxroHthuXh22GXXSmizin2yp Bitcoin
0x1b45bc41efeb3ed655b078f95086f25fc83345c4 Ethereum
AtPjUnxYFHw3a6Si9HinQtyPTqsdbfdKX3dJ1xiDjbrL Solana

If you want support project and developer with PayPal

Copyright © 2025 Tecknobit