MainAction.Custom

@Immutable
class MainAction.Custom : MainAction


Fully custom main action button.

Note: When instantiating inside a Composable, memoize onClick and icon using androidx.compose.runtime.remember to avoid unnecessary recompositions.

Summary

Public constructors

Custom(
    text: String,
    icon: Painter?,
    contentDescription: String?,
    onClick: () -> Unit,
    style: MainAction.Style
)

Public properties

String?
Painter?

Optional custom icon to display.

() -> Unit

Callback invoked when the button is clicked.

open MainAction.Style

The visual style of the button.

String

Optional label to display on the button.

Public constructors

Custom

Custom(
    text: String,
    icon: Painter? = null,
    contentDescription: String? = null,
    onClick: () -> Unit,
    style: MainAction.Style = Style.SECONDARY
)

Public properties

contentDescription

val contentDescription: String?

icon

val icon: Painter?

Optional custom icon to display. At least one of text or icon must be provided.

onClick

val onClick: () -> Unit

Callback invoked when the button is clicked.

style

open val style: MainAction.Style

The visual style of the button. Defaults to Style.SECONDARY.

text

val text: String

Optional label to display on the button. At least one of text or icon must be provided.