# SegmentedButtonDefaults

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/SegmentedButton.kt+class:androidx.compose.material3.SegmentedButtonDefaults) Common/AllAndroid/JVM
- Cmn

  ```
  object SegmentedButtonDefaults
  ```

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#ActiveIcon()()` And icon to indicate the segmented button is checked or selected | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#Icon(kotlin.Boolean,kotlin.Function0,kotlin.Function0)( active: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, activeContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html, inactiveContent: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? )` The default implementation of icons for Segmented Buttons. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#borderStroke(androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp)(color: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, width: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` Default factory for Segmented Button `https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke` can be customized through `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#borderStroke(androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp)`, and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#borderStroke(androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#colors()()` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonColors` that represents the different colors used in a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButton.composable#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)` in different states. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#colors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( activeContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, activeContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, activeBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, inactiveContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, inactiveContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, inactiveBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledActiveContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledActiveContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledActiveBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledInactiveContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledInactiveContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledInactiveBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonColors` that represents the different colors used in a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButton.composable#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)` in different states. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, baseShape: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape)` A shape constructor that the button in `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)` should have when there are `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)` buttons in the container. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#BorderWidth()` Default border width used in segmented button | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/PaddingValues` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#ContentPadding()` The default content padding used by Segmented Buttons | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#IconSize()` Icon size to use for icons used in `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButton.composable#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)` | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#baseShape()` The shape of the segmented button container, for correct behavior this should or the desired `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` should be used with `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)` and passed to each segmented button. | Cmn |

## Public functions

### ActiveIcon

Cmn

```
@Composable
fun ActiveIcon(): Unit
```

And icon to indicate the segmented button is checked or selected

### Icon

Cmn

```
@Composable
fun Icon(
    active: Boolean,
    activeContent: @Composable () -> Unit = { ActiveIcon() },
    inactiveContent: (@Composable () -> Unit)? = null
): Unit
```

The default implementation of icons for Segmented Buttons.

| Parameters |
|---|---|
| `active: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether the button is activated or not. |
| `activeContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html = { ActiveIcon() }` | usually a checkmark icon of `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#IconSize()` dimensions. |
| `inactiveContent: (@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)? = null` | typically an icon of `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#IconSize()`. It shows only when the button is not checked. |

### borderStroke

Cmn

```
fun borderStroke(color: Color, width: Dp = BorderWidth): BorderStroke
```

Default factory for Segmented Button `https://developer.android.com/reference/kotlin/androidx/compose/foundation/BorderStroke` can be customized through `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#borderStroke(androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp)`, and `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#borderStroke(androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp)`. When using a width different than default make sure to also update `https://developer.android.com/reference/kotlin/androidx/compose/material3/MultiChoiceSegmentedButtonRow.composable#MultiChoiceSegmentedButtonRow(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,kotlin.Function1)` or `https://developer.android.com/reference/kotlin/androidx/compose/material3/SingleChoiceSegmentedButtonRow.composable#SingleChoiceSegmentedButtonRow(androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,kotlin.Function1)` space param.

### colors

Cmn

```
@Composable
fun colors(): SegmentedButtonColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonColors` that represents the different colors used in a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButton.composable#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)` in different states.

### colors

Cmn

```
@Composable
fun colors(
    activeContainerColor: Color = Color.Unspecified,
    activeContentColor: Color = Color.Unspecified,
    activeBorderColor: Color = Color.Unspecified,
    inactiveContainerColor: Color = Color.Unspecified,
    inactiveContentColor: Color = Color.Unspecified,
    inactiveBorderColor: Color = Color.Unspecified,
    disabledActiveContainerColor: Color = Color.Unspecified,
    disabledActiveContentColor: Color = Color.Unspecified,
    disabledActiveBorderColor: Color = Color.Unspecified,
    disabledInactiveContainerColor: Color = Color.Unspecified,
    disabledInactiveContentColor: Color = Color.Unspecified,
    disabledInactiveBorderColor: Color = Color.Unspecified
): SegmentedButtonColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonColors` that represents the different colors used in a `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButton.composable#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)` in different states.

| Parameters |
|---|---|
| `activeContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the container when enabled and active |
| `activeContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the content when enabled and active |
| `activeBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the border when enabled and active |
| `inactiveContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the container when enabled and inactive |
| `inactiveContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the content when enabled and inactive |
| `inactiveBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the border when enabled and active |
| `disabledActiveContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the container when disabled and active |
| `disabledActiveContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the content when disabled and active |
| `disabledActiveBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the border when disabled and active |
| `disabledInactiveContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the container when disabled and inactive |
| `disabledInactiveContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the content when disabled and unchecked |
| `disabledInactiveBorderColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.Unspecified` | the color used for the border when disabled and inactive |

### itemShape

Cmn

```
@Composable
fun itemShape(
    index: Int,
    count: Int,
    baseShape: CornerBasedShape = this.baseShape
): Shape
```

A shape constructor that the button in `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)` should have when there are `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)` buttons in the container.

| Parameters |
|---|---|
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the index for this button in the row |
| `count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the count of buttons in this row |
| `baseShape: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape = this.baseShape` | the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` the base shape that should be used in buttons that are not in the start or the end. |

## Public properties

### BorderWidth

Cmn

```
val BorderWidth: Dp
```

Default border width used in segmented button

### ContentPadding

Cmn

```
val ContentPadding: PaddingValues
```

The default content padding used by Segmented Buttons

### IconSize

Cmn

```
val IconSize: Dp
```

Icon size to use for icons used in `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButton.composable#(androidx.compose.material3.MultiChoiceSegmentedButtonRowScope).SegmentedButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.graphics.Shape,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.compose.material3.SegmentedButtonColors,androidx.compose.foundation.BorderStroke,androidx.compose.foundation.layout.PaddingValues,androidx.compose.foundation.interaction.MutableInteractionSource,kotlin.Function0,kotlin.Function0)`

### baseShape

Cmn

```
val baseShape: CornerBasedShape
```

The shape of the segmented button container, for correct behavior this should or the desired `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` should be used with `https://developer.android.com/reference/kotlin/androidx/compose/material3/SegmentedButtonDefaults#itemShape(kotlin.Int,kotlin.Int,androidx.compose.foundation.shape.CornerBasedShape)` and passed to each segmented button.