# ButtonGroupScope

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/ButtonGroup.kt+class:androidx.wear.compose.material3.ButtonGroupScope) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)


```
interface ButtonGroupScope
```

<br />

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).animateWidth(androidx.compose.foundation.interaction.InteractionSource)(interactionSource: https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/InteractionSource)` Specifies the interaction source to use with this item. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).minWidth(androidx.compose.ui.unit.Dp)(minWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` Specifies the minimum width this item can be, in Dp. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).weight(kotlin.Float)( weight: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroup.composable#ButtonGroup(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.ui.Alignment.Vertical,androidx.wear.compose.material3.SurfaceTransformation,kotlin.Function1)` uses a ratio of all sibling item `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).weight(kotlin.Float)`s to assign a width to each item. |

## Public functions

### Modifier.animateWidth

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/ButtonGroup.kt+function:animateWidth) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

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

### Modifier.minWidth

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/ButtonGroup.kt+function:minWidth) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.6.0)

```
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 an item falling below its minimum width. Note that this is only used before animations, pressing a button may result in neighbor button(s) going below their minWidth. See also `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).weight(kotlin.Float)`

| Parameters |
|---|---|
| `minWidth: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp = ButtonGroupDefaults.MinWidth` | the minimum width. If none is specified, minimumInteractiveComponentSize is used. |

### Modifier.weight

Artifact: [androidx.wear.compose:compose-material3](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material3/ButtonGroup.kt+function:weight) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

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

`https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroup.composable#ButtonGroup(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.PaddingValues,androidx.compose.ui.Alignment.Vertical,androidx.wear.compose.material3.SurfaceTransformation,kotlin.Function1)` uses a ratio of all sibling item `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).weight(kotlin.Float)`s to assign a width to each item. The horizontal space is distributed using `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).weight(kotlin.Float)` first, and this will only be changed if any item would be smaller than its `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).minWidth(androidx.compose.ui.unit.Dp)`. See also `https://developer.android.com/reference/kotlin/androidx/wear/compose/material3/ButtonGroupScope#(androidx.compose.ui.Modifier).minWidth(androidx.compose.ui.unit.Dp)`.

| Parameters |
|---|---|
| `weight: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, fromInclusive = false) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The main way of distributing available space. This is a relative measure, and items with no weight specified will have a default of 1f. |