CarouselTileSchema

@Serializable
@SerialName(value = "Carousel")
data class CarouselTileSchema(val id: String, val tiles: SerializableImmutableList<TileSchema>, val events: SerializableImmutableList<EventSchema>?, val style: StyleSchema, val searchableTerms: SerializableImmutableList<String>?, val visibility: TileSchema.Visibility, val type: CarouselTileSchema.CarouselTypeSchema, val itemSpacing: Int = 0, val contentPadding: Int = 0, val userScrollEnabled: Boolean = true) : TileSchema

Renders a Material 3 horizontal carousel over tiles, one child per carousel item. type picks the composable:

itemSpacing and contentPadding are interpreted as dp — the padding is applied horizontally only — and userScrollEnabled toggles manual swiping.

Item control: the tile listens to the screen broadcast channel and reacts to scroll-to-begin, scroll-to-end, next-item and previous-item commands addressed to its id, each optionally animated. It shares the pager's broadcast, so the same scroll event drives both tiles — just point it at this carousel's id. The resulting item is clamped to the valid range, so asking for the next item on the last one (or the previous on the first) is a no-op.

Triggers dispatched:

  • OnDisplayEventTrigger — fired once when the tile enters composition (keyed by tile id).

  • OnPageChangedEventTrigger — fired whenever the current item changes (the initial item is skipped). The trigger is dispatched once per direction the new item matches, and each dispatch only reaches the events wired to that exact direction: Direction.Any always, Direction.Start when landing on the first item, Direction.End when landing on the last item, and Direction.Index(item) for the new index.

Notes: children are rendered by index without a scope CompositionLocal.

Constructors

Link copied to clipboard
constructor(id: String, tiles: SerializableImmutableList<TileSchema>, events: SerializableImmutableList<EventSchema>?, style: StyleSchema, searchableTerms: SerializableImmutableList<String>?, visibility: TileSchema.Visibility, type: CarouselTileSchema.CarouselTypeSchema, itemSpacing: Int = 0, contentPadding: Int = 0, userScrollEnabled: Boolean = true)

Types

Link copied to clipboard
@Serializable
sealed interface CarouselTypeSchema

Properties

Link copied to clipboard
@SerialName(value = "contentPadding")
val contentPadding: Int
Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?
Link copied to clipboard
@SerialName(value = "id")
open override val id: String
Link copied to clipboard
@SerialName(value = "itemSpacing")
val itemSpacing: Int
Link copied to clipboard
@SerialName(value = "searchableTerms")
open override val searchableTerms: SerializableImmutableList<String>?
Link copied to clipboard
@SerialName(value = "style")
open override val style: StyleSchema
Link copied to clipboard
@SerialName(value = "tiles")
val tiles: SerializableImmutableList<TileSchema>
Link copied to clipboard
@SerialName(value = "carouselType")
val type: CarouselTileSchema.CarouselTypeSchema
Link copied to clipboard
@SerialName(value = "userScrollEnabled")
val userScrollEnabled: Boolean
Link copied to clipboard
@SerialName(value = "visibility")
open override val visibility: TileSchema.Visibility

Functions

Link copied to clipboard
open fun isGone(): Boolean
Link copied to clipboard
open fun isVisible(): Boolean