ButtonGroupScope
interface ButtonGroupScope
Button group scope used to indicate a Modifier.weight and Modifier.animateWidth of a child element. Also defines the DSL to build the content of a ButtonGroup
Functions
Link copied to clipboard
Specifies the interaction source to use with this item. This is used to listen to events and animate growing the pressed button and shrink the neighbor(s).
Link copied to clipboard
abstract fun clickableItem(onClick: () -> Unit, label: String, icon: @Composable () -> Unit? = null, weight: Float = Float.NaN, enabled: Boolean = true)
Adds a clickable item to the ButtonGroup.
Link copied to clipboard
abstract fun customItem(buttonGroupContent: @Composable () -> Unit, menuContent: @Composable (ButtonGroupMenuState) -> Unit)
Adds a custom item to the ButtonGroup.
Link copied to clipboard
abstract fun toggleableItem(checked: Boolean, label: String, onCheckedChange: (Boolean) -> Unit, icon: @Composable () -> Unit? = null, weight: Float = Float.NaN, enabled: Boolean = true)
Adds a toggleable item to the ButtonGroup.
Link copied to clipboard
abstract fun Modifier.weight(@FloatRange(from = 0.0, fromInclusive = false) weight: Float): Modifier
Size the element's width proportional to its weight relative to other weighted sibling elements in the ButtonGroup. The parent will divide the horizontal space remaining after measuring unweighted child elements and distribute it according to this weight.