androidx.compose.material3
ToggleFloatingActionButtonSince 1.10
Composable function
A part of FloatingActionButtonMenu. See that page for an overview and examples.
Parameters
@Composable
fun ToggleFloatingActionButton(
checked: Boolean,
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
containerColor: (Float) -> Color = ToggleFloatingActionButtonDefaults.containerColor(),
contentAlignment: Alignment = Alignment.TopEnd,
containerSize: (Float) -> Dp = ToggleFloatingActionButtonDefaults.containerSize(),
containerCornerRadius: (Float) -> Dp = ToggleFloatingActionButtonDefaults.containerCornerRadius(),
content: @Composable ToggleFloatingActionButtonScope.() -> Unit,
)
checked: BooleanRequired
checked: BooleanRequiredWhether the toggle button is in the open state.
onCheckedChange: (Boolean) -> UnitRequired
onCheckedChange: (Boolean) -> UnitRequiredCalled with the new value when the toggle button is clicked. Update your state here.
containerColor: (Float) -> ColorOptional
containerColor: (Float) -> ColorOptionalDefault: ToggleFloatingActionButtonDefaults.containerColor()
The background color. For the toggle button, a function of the progress, from closed to open color.
contentAlignment: AlignmentOptional
contentAlignment: AlignmentOptionalDefault: Alignment.TopEnd
Where the icon sits while the toggle button changes size.
containerSize: (Float) -> DpOptional
containerSize: (Float) -> DpOptionalDefault: ToggleFloatingActionButtonDefaults.containerSize()
The size of the toggle button, as a function of the progress. Use the sizes in ToggleFloatingActionButtonDefaults.
containerCornerRadius: (Float) -> DpOptional
containerCornerRadius: (Float) -> DpOptionalDefault: ToggleFloatingActionButtonDefaults.containerCornerRadius()
The corner radius of the toggle button, as a function of the progress.
content: @Composable ToggleFloatingActionButtonScope.() -> UnitRequired
content: @Composable ToggleFloatingActionButtonScope.() -> UnitRequiredThe actions. Add one FloatingActionButtonMenuItem each.
Same as in FloatingActionButtonMenu: modifier.
Parts
FloatingActionButtonMenuFloatingActionButtonMenuItemToggleFloatingActionButton