Skip to content

Button

Primitive unstyled Button component.

implementation("io.daio.wild:button:<version>")

Usage

Button(onClick = {
    println("Clicked")
}) {
    Text("Click Me!")
}

Customisation

You can customise the Button by overriding the default options.

Button(
    modifier = Modifier,
    style = StyleDefaults.style(),
    onClick = {
        println("Clicked")
    },
) {
    Text("Click Me!")
}

All customisation options support state based values for focus, pressed etc.

StyleDefaults.colors(
    backgroundColor = Color.Blue,
    contentColor = Color.White,
    focusedBackgroundColor = Color.Red,
    pressedBackgroundColor = Color.Green,
    disabledBackgroundColor = Color.Gray.copy(alpha = .6f),
    focusedDisabledBackgroundColor = Color.Red.copy(alpha = .6f),
)
Platform Available
CMP
Android Tv

You can see the full api here