ButtonElement

data class ButtonElement(val text: String, val onClick: () -> Unit, val sentiment: Sentiment = Sentiment.Nominal, val enabled: Boolean = true, val latchOnPress: Boolean = false, val leadingSymbol: Symbol? = null, val trailingSymbol: Symbol? = null) : UiElement.Interactive

A clickable button not a part of a block of text.

Constructors

Link copied to clipboard
constructor(text: String, onClick: () -> Unit, sentiment: Sentiment = Sentiment.Nominal, enabled: Boolean = true, latchOnPress: Boolean = false, leadingSymbol: Symbol? = null, trailingSymbol: Symbol? = null)

Properties

Link copied to clipboard
val enabled: Boolean = true

Flag to enable/disable the button.

Link copied to clipboard
val latchOnPress: Boolean = false

Whether to disable the button temporarily after pressing.

Link copied to clipboard
val leadingSymbol: Symbol? = null

Symbol displayed at the start of the button.

Link copied to clipboard
val onClick: () -> Unit

Action to be invoked when the button is clicked.

Link copied to clipboard

Signifier of the button's action or current state.

Link copied to clipboard

Text to display in the button element

Link copied to clipboard
val trailingSymbol: Symbol? = null

Symbol displayed at the end of the button.