ButtonCore¶
A stateless clickable container composable.
ButtonCore manages hover and pressed state internally and exposes them to content via the lambda parameters. It handles cursor changes and the full pointer-event lifecycle, but applies no visual styling of its own — that is left entirely to content.
Use ButtonCore when you need custom button visuals. For a standard themed button, use the higher-level Button composable in your theme-aware composables package.
Example¶
ButtonCore(onClick = { println("Clicked!") }) { isHovered, isPressed ->
Box(
modifier = Modifier.background(if (isHovered) KColor.LIGHT_GRAY else KColor.GRAY)
.size(80, 20)
) {
Text(Component.literal("Click me"))
}
}