ButtonTileSchema

@Serializable
@SerialName(value = "Button")
data class ButtonTileSchema(val id: String, val events: SerializableImmutableList<EventSchema>?, val style: StyleSchema, val searchableTerms: SerializableImmutableList<String>?, val visibility: TileSchema.Visibility, val text: String, val icon: IconSchema? = null, val buttonType: ButtonTileSchema.Type = Type.FILLED, val shape: ButtonTileSchema.Shape = Shape.ROUNDED, val loading: Boolean = false, val enabled: Boolean = true, val iconPosition: ButtonTileSchema.IconPosition = IconPosition.START) : TileSchema

Renders a Material 3 button. The concrete composable is picked by buttonType: Type.FILLEDButton, Type.ELEVATEDElevatedButton, Type.FILLED_TONALFilledTonalButton, Type.OUTLINEDOutlinedButton, Type.TEXTTextButton.

Content: when loading is true the button shows a 24dp CircularProgressIndicator (2dp stroke, round cap, tinted with LocalContentColor) instead of its normal content. Otherwise it renders text together with the optional icon, ordered by iconPosition (IconPosition.START → icon, 8dp spacer, text; IconPosition.END → text, 8dp spacer, icon).

Shape: Shape.SQUARE maps to MaterialTheme.shapes.medium, Shape.ROUNDED to CircleShape.

Enabled state: the button is interactive only when enabled is true and loading is false — the two are combined into the single enabled the Material button receives, so a loading button is disabled for real: it takes Material's disabled colors and is reported as disabled to accessibility services. A slow action therefore cannot be submitted twice.

Triggers dispatched:

  • OnClickEventTrigger — fired when the button is tapped while interactive.

Constructors

Link copied to clipboard
constructor(id: String, events: SerializableImmutableList<EventSchema>?, style: StyleSchema, searchableTerms: SerializableImmutableList<String>?, visibility: TileSchema.Visibility, text: String, icon: IconSchema? = null, buttonType: ButtonTileSchema.Type = Type.FILLED, shape: ButtonTileSchema.Shape = Shape.ROUNDED, loading: Boolean = false, enabled: Boolean = true, iconPosition: ButtonTileSchema.IconPosition = IconPosition.START)

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
@SerialName(value = "buttonType")
val buttonType: ButtonTileSchema.Type
Link copied to clipboard
@SerialName(value = "enabled")
val enabled: Boolean
Link copied to clipboard
@SerialName(value = "events")
open override val events: SerializableImmutableList<EventSchema>?
Link copied to clipboard
@SerialName(value = "icon")
val icon: IconSchema?
Link copied to clipboard
@SerialName(value = "iconPosition")
val iconPosition: ButtonTileSchema.IconPosition
Link copied to clipboard
@SerialName(value = "id")
open override val id: String
Link copied to clipboard
@SerialName(value = "loading")
val loading: Boolean
Link copied to clipboard
@SerialName(value = "searchableTerms")
open override val searchableTerms: SerializableImmutableList<String>?
Link copied to clipboard
@SerialName(value = "shape")
val shape: ButtonTileSchema.Shape
Link copied to clipboard
@SerialName(value = "style")
open override val style: StyleSchema
Link copied to clipboard
@SerialName(value = "text")
val text: String
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