Button

Button - A UI component for interactive buttons.

This component provides:

  • Click, long press, and double click interactions

  • Customizable styling and appearance

  • Support for icons and text

  • Different button states (normal, pressed, disabled)

  • Loading state support

  • Custom button shapes and sizes

Constructors

Link copied to clipboard
constructor(options: ButtonOptions)

Properties

Link copied to clipboard
open override val currentStyle: ComponentStyle

Get the current style of this component.

Link copied to clipboard
open override val id: String

Unique identifier for this UI component.

Link copied to clipboard
open override val isEnabled: Boolean

Whether this component is currently enabled.

Link copied to clipboard
val isLoading: StateFlow<Boolean>
Link copied to clipboard
val isPressed: StateFlow<Boolean>
Link copied to clipboard
open override val isVisible: Boolean

Whether this component is currently visible.

Functions

Link copied to clipboard
open override fun applyStyle(style: ComponentStyle)

Apply a style to this component.

Link copied to clipboard
fun click()

Trigger the button click programmatically.

Link copied to clipboard
open override fun disable()

Disable this component.

Link copied to clipboard
open override fun dispose()

Dispose of this component and release resources.

Link copied to clipboard
open override fun enable()

Enable this component.

Link copied to clipboard
fun getIcon(): String?

Get the current button icon.

Link copied to clipboard

Get the current button state.

Link copied to clipboard
fun getText(): String?

Get the current button text.

Link copied to clipboard
open override fun handleInteraction(event: InteractionEvent)

Handle a user interaction event.

Link copied to clipboard
open override fun hide()

Hide this component.

Link copied to clipboard
fun setIcon(icon: String)

Set the button icon.

Link copied to clipboard
fun setLoading(loading: Boolean)

Set the loading state of the button.

Link copied to clipboard
fun setText(text: String)

Set the button text.

Link copied to clipboard
open override fun show()

Show this component.