Button
An accessible clickable component used to create buttons with the styling of your choice.
For interactive preview & code examples, visit Button Documentation.
Basic Example
Button(
onClick = { /* TODO */},
backgroundColor = Color(0xFFFFFFFF),
contentColor = Color(0xFF020817),
contentPadding = PaddingValues(horizontal = 16.dp, vertical = 12.dp),
shape = RoundedCornerShape(12.dp),
) {
Text("Submit")
}Parameters
The callback to be invoked when the button is clicked.
Modifier to be applied to the button.
Whether the button is enabled.
The shape of the button.
The background color of the button.
The color to apply to the contents of the button.
Padding values for the content.
The color of the border. Applied only if both borderColor is specified and borderWidth is 0.dp
The width of the border. Applied only if both borderColor is specified and borderWidth is 0.dp
The role of the button for accessibility purposes.
The indication to be shown when the button is interacted with.
The interaction source for the button.
The vertical alignment of the button's children.
The horizontal arrangement of the button's children.
A composable function that defines the content of the button.