Kwik Floating Action Button
fun KwikFloatingActionButton(modifier: Modifier = Modifier, contentColor: Color = MaterialTheme.colorScheme.onPrimary, containerColor: Color = MaterialTheme.colorScheme.primary, shape: Shape = FloatingActionButtonDefaults.extendedFabShape, elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, loading: Boolean = false, loadingText: String? = null, enabled: Boolean = true, onClick: () -> Unit, content: @Composable () -> Unit)
A floating action button that can be customized to suit different use cases.
Parameters
modifier
Modifier to be applied to the button.
container Color
The color of the button.
content Color
The color of the icon.
shape
The shape of the button.
loading
Whether the button is in a loading state.
loading Text
The text to be displayed when the button is in a loading state.
enabled
Whether the button is enabled.
elevation
The elevation of the button.
interaction Source
The interaction source of the button.
on Click
The action to be performed when the button is clicked.
content
The content of the button.
Example usage:
KwikExtendedFloatingActionButton(
text = { Text(text = "Action", style = MaterialTheme.typography.titleSmall) },
icon = { Icon(Icons.Sharp.Share, tint = Color.White, contentDescription = "share") },
containerColor = MaterialTheme.colorScheme.primary,
onClick = { /* Do something */}
)
Content copied to clipboard