KButton
Shadcn/ui-style Button — mirrors button.tsx.
A versatile button component that supports various visual variants, sizes, and states (including a loading state). It adheres to the Kindling design system and ensures proper accessibility and RTL support.
Respects LocalLayoutDirection automatically — icon/content order is never reversed programmatically; rely on Compose's RTL mirroring.
Example usage:
// Primary action
KButton(onClick = { /* Save */}) {
Text("Save")
}
// Outline variant with small size
KButton(
onClick = { /* Cancel */},
variant = KButtonVariant.Outline,
size = KButtonSize.Sm
) {
Text("Cancel")
}
// Loading state
KButton(onClick = {}, isLoading = true) {
Text("Logging in...")
}Parameters
Callback invoked when the button is clicked.
The modifier to be applied to the button.
The visual style variant of the button. Defaults to KButtonVariant.Default.
The size variant of the button. Defaults to KButtonSize.Default.
Whether the button is enabled for interaction.
Whether to show a loading indicator instead of the content.
The MutableInteractionSource to represent the stream of interactions.
The composable content to display inside the button (typically text or an icon).
A convenience overload of KButton that accepts a plain string as a label.
Example usage:
KButton(text = "Submit", onClick = { /* Submit form */})Parameters
The label text to display inside the button.
Callback invoked when the button is clicked.
The modifier to be applied to the button.
The visual style variant of the button.
The size variant of the button.
Whether the button is enabled for interaction.
Whether to show a loading indicator instead of the content.