Tabs

fun TileSchemaBuilderScope.Tabs(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = {}, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, selectedTabId: String, tabType: TabsTileSchema.Type = primaryTabs(), scrollable: Boolean = false, tabItems: TabItemSchemaBuilderScope.() -> Unit)

Renders a Material 3 tab row with one tab per entry declared via tabItems (built with addTab). tabType picks the emphasis — primary or secondary — and scrollable chooses between a fixed row and a scrollable one. Each tab shows its label and icon, both optional; the selected tab is the one whose id equals selectedTabId — when it matches none of tabItems the first tab is highlighted as a fallback, and an empty tabItems renders nothing at all. When a tab's badge text is set (via addTab), it gets a badge attached to its icon (or its label when it has none) — an empty string renders a small dot badge, any other value renders as the badge's text. Tapping a tab flips selectedTabId locally on the client (no server round trip needed for the indicator to move); the tile only tracks the selection, so swapping the content shown below the tabs is up to the events wired to the tab clicks. Dispatches onTabItemClick(tabId) when a tab is tapped, so events can be wired per tab.

Parameters

id

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

events

Events owned by this tile, wired to its triggers (e.g. onTabItemClick).

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.

selectedTabId

Id of the currently selected tab.

tabType

Emphasis of the tab row — primaryTabs or secondaryTabs. Defaults to primary.

scrollable

Whether the tab row scrolls horizontally instead of being fixed-width. Defaults to false.

tabItems

Tab entries, declared with addTab.