# SwitchDefaults

Artifact: [androidx.glance:glance-appwidget](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/appwidget/Switch.kt+class:androidx.glance.appwidget.SwitchDefaults) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)


```
object SwitchDefaults
```

<br />

*** ** * ** ***

Contains the default values used by `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)`.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SwitchColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SwitchDefaults#colors()()` SwitchColors to tint the thumb and track of the `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)` according to the checked state. |
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SwitchColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SwitchDefaults#colors(androidx.glance.unit.ColorProvider,androidx.glance.unit.ColorProvider,androidx.glance.unit.ColorProvider,androidx.glance.unit.ColorProvider)( checkedThumbColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider, uncheckedThumbColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider, checkedTrackColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider, uncheckedTrackColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider )` SwitchColors to tint the thumb and track of the `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)` according to the checked state. |

## Public functions

### colors

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

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

SwitchColors to tint the thumb and track of the `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)` according to the checked state.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SwitchColors` | a default set of `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/SwitchColors`. |

### colors

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

```
@Composable
fun colors(
    checkedThumbColor: ColorProvider,
    uncheckedThumbColor: ColorProvider,
    checkedTrackColor: ColorProvider,
    uncheckedTrackColor: ColorProvider
): SwitchColors
```

SwitchColors to tint the thumb and track of the `https://developer.android.com/reference/kotlin/androidx/glance/appwidget/Switch.composable#Switch(kotlin.Boolean,androidx.glance.action.Action,androidx.glance.GlanceModifier,kotlin.String,androidx.glance.text.TextStyle,androidx.glance.appwidget.SwitchColors,kotlin.Int)` according to the checked state.

| Parameters |
|---|---|
| `checkedThumbColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider` | the tint to apply to the thumb of the switch when it is checked |
| `uncheckedThumbColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider` | the tint to apply to the thumb of the switch when it is not checked |
| `checkedTrackColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider` | the tint to apply to the track of the switch when it is checked |
| `uncheckedTrackColor: https://developer.android.com/reference/kotlin/androidx/glance/unit/ColorProvider` | the tint to apply to the track of the switch when it is not checked |