class ButtonGroupScope


Scope for the children of a ButtonGroup

Summary

Public constructors

Public functions

Boolean
buttonGroupItem(
    interactionSource: InteractionSource,
    minWidth: Dp,
    weight: Float,
    content: @Composable () -> Unit
)

Adds an item to a ButtonGroup

Public constructors

ButtonGroupScope

Added in 1.0.0-alpha30
ButtonGroupScope()

Public functions

buttonGroupItem

fun buttonGroupItem(
    interactionSource: InteractionSource,
    minWidth: Dp = minimumInteractiveComponentSize,
    weight: Float = 1.0f,
    content: @Composable () -> Unit
): Boolean

Adds an item to a ButtonGroup

Parameters
interactionSource: InteractionSource

the interactionSource used to detect press/release events. Should be the same one used in the content in this slot, which is typically a Button.

minWidth: Dp = minimumInteractiveComponentSize

the minimum width this item can be. This will only be used if distributing the available space results on a item falling below it's minimum width.

weight: Float = 1.0f

the main way of distributing available space. In most cases, items will have a width assigned proportional to their width (and available space). The exception is if that will make some item(s) width fall below it's minWidth.

content: @Composable () -> Unit

the content to use for this item. Usually, this will be one of the Button variants.