AppCarousel

fun AppCarousel(itemCount: Int, modifier: Modifier = Modifier, title: StringResource, isPager: Boolean = true, spacing: Dp = if (isPager) 0.dp else 8.dp, contentPadding: PaddingValues = PaddingValues(0.dp), pagerState: PagerState = rememberPagerState { itemCount }, showIndicator: Boolean = isPager, itemContent: @Composable (index: Int) -> Unit)

A generic carousel component that supports both paging (one item at a time) and standard horizontal scrolling (list of items). This version accepts a StringResource for the title.

Parameters

itemCount

The total number of items in the carousel.

modifier

The modifier to be applied to the carousel container.

title

The StringResource title displayed above the carousel.

isPager

If true, uses a HorizontalPager for snapping behavior. If false, uses a LazyRow.

spacing

The spacing between items.

contentPadding

The padding to be applied around the content.

pagerState

The state for the pager (only used if isPager is true).

showIndicator

If true, shows a page indicator (only used if isPager is true).

itemContent

The composable content for each item.


fun AppCarousel(itemCount: Int, modifier: Modifier = Modifier, title: String? = null, isPager: Boolean = true, spacing: Dp = if (isPager) 0.dp else 8.dp, contentPadding: PaddingValues = if (isPager) PaddingValues(0.dp) else PaddingValues(horizontal = 16.dp), pagerState: PagerState = rememberPagerState { itemCount }, showIndicator: Boolean = isPager, itemContent: @Composable (index: Int) -> Unit)

A generic carousel component that supports both paging (one item at a time) and standard horizontal scrolling (list of items). This version accepts an optional raw String for the title.

Parameters

itemCount

The total number of items in the carousel.

modifier

The modifier to be applied to the carousel container.

title

Optional title displayed above the carousel.

isPager

If true, uses a HorizontalPager for snapping behavior. If false, uses a LazyRow.

spacing

The spacing between items.

contentPadding

The padding to be applied around the content.

pagerState

The state for the pager (only used if isPager is true).

showIndicator

If true, shows a page indicator (only used if isPager is true).

itemContent

The composable content for each item.