Kwik Horizontal Tabs
fun KwikHorizontalTabs(tabs: List<KwikTabItem>, pagerState: PagerState, containerColor: Color = MaterialTheme.colorScheme.surface, indicatorColor: Color = MaterialTheme.colorScheme.primary, kwikIndicatorProps: KwikIndicatorProps = KwikIndicatorProps(), divider: @Composable () -> Unit = {}, selectedContentColor: Color = MaterialTheme.colorScheme.primary, unselectedContentColor: Color = Color.Gray)
A versatile horizontal tab pager capable of displaying any content. Can be used independently or with a pager.
Parameters
tabs
List of tabs to display
pager State
The state of the pager
kwik Indicator Props
The properties of the indicator. Refer to KwikIndicatorProps for more details.
container Color
The background color of the tab row
indicator Color
The color of the indicator
divider
The divider to display between tabs
selected Content Color
The color of the selected tab
unselected Content Color
The color of the unselected tab
Usage example:
val list = listOf(
KwikTabItem(
title = "Muraho",
content = {
Text(text = "Muraho")
}
),
KwikTabItem(
title = "Hello",
content = {
Text(text = "Hello")
}
),
KwikTabItem(
title = "Jambo",
content = {
Text(text = "Jambo")
}
)
)
val pagerState = rememberPagerState(
initialPage = 0,
initialPageOffsetFraction = 0f
) {
list.size
}
KwikHorizontalTab(
tabs = list,
pagerState = pagerState
)
```
Content copied to clipboard