# ToggleButtonDefaults

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

<br />

```
object ToggleButtonDefaults
```

<br />

*** ** * ** ***

Contains the default values used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#toggleButtonColors(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)( checkedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, checkedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledCheckedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledCheckedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, uncheckedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, uncheckedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledUncheckedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, disabledUncheckedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors` that represents the background and content colors used in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#DefaultIconSize()` The default size of an icon when used inside a default-sized `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/Role` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#DefaultRole()` Role semantics that accessibility services can use to provide more context to users. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#DefaultToggleButtonSize()` The default size applied for the `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#SmallIconSize()` The size of an icon when used inside a small-sized `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonDefaults#SmallToggleButtonSize()` The recommended size for a small `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. |

## Public functions

### toggleButtonColors

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.6.0)

```
@Composable
fun toggleButtonColors(
    checkedBackgroundColor: Color = MaterialTheme.colors.primary,
    checkedContentColor: Color = contentColorFor(checkedBackgroundColor),
    disabledCheckedBackgroundColor: Color = checkedBackgroundColor.copy(alpha = ContentAlpha.disabled),
    disabledCheckedContentColor: Color = MaterialTheme.colors.background,
    uncheckedBackgroundColor: Color = MaterialTheme.colors.surface,
    uncheckedContentColor: Color = contentColorFor(uncheckedBackgroundColor),
    disabledUncheckedBackgroundColor: Color = uncheckedBackgroundColor.copy(alpha = ContentAlpha.disabled),
    disabledUncheckedContentColor: Color = uncheckedContentColor.copy(alpha = ContentAlpha.disabled)
): ToggleButtonColors
```

Creates a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButtonColors` that represents the background and content colors used in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. Defaults to primary-styled checked colors and surface-styled unchecked colors.

| Parameters |
|---|---|
| `checkedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colors.primary` | the background color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when enabled and checked |
| `checkedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = contentColorFor(checkedBackgroundColor)` | the content color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when enabled and checked |
| `disabledCheckedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = checkedBackgroundColor.copy(alpha = ContentAlpha.disabled)` | the background color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when checked and not enabled |
| `disabledCheckedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colors.background` | the content color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when checked and not enabled |
| `uncheckedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colors.surface` | the background color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when enabled and unchecked |
| `uncheckedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = contentColorFor(uncheckedBackgroundColor)` | the content color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when enabled and unchecked |
| `disabledUncheckedBackgroundColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = uncheckedBackgroundColor.copy(alpha = ContentAlpha.disabled)` | the background color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when unchecked and not enabled |
| `disabledUncheckedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = uncheckedContentColor.copy(alpha = ContentAlpha.disabled)` | the content color of this `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)` when unchecked and not enabled |

## Public properties

### DefaultIconSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val DefaultIconSize: Dp
```

The default size of an icon when used inside a default-sized `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`.

### DefaultRole

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)

```
val DefaultRole: Role
```

Role semantics that accessibility services can use to provide more context to users.

### DefaultToggleButtonSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val DefaultToggleButtonSize: Dp
```

The default size applied for the `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. Note that you can override it by applying Modifier.size directly on `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`.

### SmallIconSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val SmallIconSize: Dp
```

The size of an icon when used inside a small-sized `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`.

### SmallToggleButtonSize

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)

```
val SmallToggleButtonSize: Dp
```

The recommended size for a small `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`. You can apply this value for the size by overriding Modifier.size directly on `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/ToggleButton.composable#ToggleButton(kotlin.Boolean,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,androidx.wear.compose.material.ToggleButtonColors,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.ui.semantics.Role,kotlin.Function1)`.