interface ButtonGroupScope


Summary

Public functions

Modifier

Specifies the interaction source to use with this item.

Modifier
Modifier.minWidth(minWidth: Dp)

Specifies the minimum width this item can be, in Dp.

Modifier
Modifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float
)

ButtonGroup uses a ratio of all sibling item weights to assign a width to each item.

Public functions

fun Modifier.animateWidth(interactionSource: InteractionSource): Modifier

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).

fun Modifier.minWidth(minWidth: Dp = ButtonGroupDefaults.MinWidth): Modifier

Specifies the minimum width this item can be, in Dp. This will only be used if distributing the available space results in a item falling below its minimum width. Note that this is only used before animations, pressing a button may result on neighbor button(s) going below their minWidth. See also Modifier.weight

Parameters
minWidth: Dp = ButtonGroupDefaults.MinWidth

the minimum width. If none is specified, minimumInteractiveComponentSize is used.

fun Modifier.weight(
    weight: @FloatRange(from = 0.0, fromInclusive = false) Float
): Modifier

ButtonGroup uses a ratio of all sibling item weights to assign a width to each item. The horizontal space is distributed using weight first, and this will only be changed if any item would be smaller than its minWidth. See also Modifier.minWidth.

Parameters
weight: @FloatRange(from = 0.0, fromInclusive = false) Float

The main way of distributing available space. This is a relative measure, and items with no weight specified will have a default of 1f.