IconButton

fun TileSchemaBuilderScope.IconButton(id: String = randomId(), events: EventSchemaBuilderScope.() -> Unit = {}, style: StyleSchemaBuilderScope.() -> Unit = { size( width = wrapHorizontally(), height = wrapVertically() ) }, visibility: TileSchema.Visibility = visible(), searchableTerms: List<String>? = null, icon: IconSchema, buttonType: IconButtonTileSchema.Type = defaultIconButton(), loading: Boolean = false, enabled: Boolean = true)

Renders a Material 3 icon button. The visual variant is picked by buttonType (default, filled, filled tonal or outlined). Shows icon with its color, size and style applied. When loading is true the button shows a spinner instead of the icon, and is disabled for real regardless of enabled so a slow action cannot be submitted twice. Dispatches onClick when tapped while interactive.

Parameters

id

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

events

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

style

Layout/appearance modifiers (size, padding, background, etc). Defaults to wrapping its content.

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.

icon

Icon rendered inside the button.

buttonType

Visual variant of the button — defaultIconButton, filledIconButton, filledTonalIconButton or outlinedIconButton. Defaults to default.

loading

Whether to show a loading spinner instead of the icon and force the button disabled. Defaults to false.

enabled

Whether the button is interactive. Ignored (treated as disabled) while loading is true. Defaults to true.