Carousel

fun TileSchemaBuilderScope.Carousel(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, type: CarouselTileSchema.CarouselTypeSchema, itemSpacing: Int = 0, contentPadding: Int = 0, userScrollEnabled: Boolean = true, tiles: TileSchemaBuilderScope.() -> Unit)

Renders a Material 3 horizontal carousel over tiles, one child per item. type picks the layout — multiBrowse sizes items around a preferred width with shrunken edge items, or uncontained uses a fixed item width. itemSpacing and contentPadding (applied horizontally only) are in dp, and userScrollEnabled toggles manual swiping. Listens for scroll-to-begin/end and next/previous-item broadcasts addressed to its id — it shares the pager's broadcast, so the same commands work on both tile types. Requesting the next item past the last one (or the previous one before the first) is a no-op. Children are rendered by index with no scope CompositionLocal. Dispatches onDisplay once when composed, and onPageChanged whenever the current item changes (skipping the initial item) — once per matching direction (any / start / end / that exact index).

Parameters

id

Unique identifier of the tile. Defaults to a random id.

events

Events owned by this tile, wired to its triggers (onDisplay, onPageChanged).

style

Layout/appearance modifiers (size, padding, background, etc).

visibility

Whether the tile is shown, hidden but occupies space, or removed from layout. Defaults to visible.

searchableTerms

Terms used by an ancestor's search/filter to decide whether this tile matches. Defaults to none.

type

Item layout strategy — multiBrowse or uncontained.

itemSpacing

Spacing between items, in dp. Defaults to 0.

contentPadding

Horizontal padding applied to the carousel's content, in dp. Defaults to 0.

userScrollEnabled

Whether the user can manually swipe between items. Defaults to true.

tiles

Child tiles rendered one per carousel item.