---
title: "IconToggleButtonDefaults"
description: "Contains default values used by IconToggleButtons."
type: "object"
lastmod: "2026-05-08T01:17:00.920203Z"
---
## API Reference

> Source set: Android

```kotlin
public object IconToggleButtonDefaults
```

Contains default values used by [IconToggleButton](/jetpack-compose/androidx.xr.glimmer/glimmer/components/IconToggleButton)s.

## Properties

### contentPadding

> Source set: Android

```kotlin
@get:Composable
public val contentPadding: PaddingValues
```

Default content padding used for an [IconToggleButton](/jetpack-compose/androidx.xr.glimmer/glimmer/components/IconToggleButton).

## Functions

### shape

```kotlin
@Composable
public fun shape(
    checked: Boolean,
    checkedShape: Shape = ToggleButtonDefaults.CheckedShape,
    uncheckedShape: Shape = GlimmerTheme.shapes.large,
): Shape
```

Chooses a [Shape](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/Shape) based on the [checked](/jetpack-compose/androidx.compose.foundation/foundation/functions/checked) state and can be used to override the default
Glimmer button shapes. Note that it simply switches shapes without animation.

If you require an animated version, please refer to [IconToggleButtonDefaults.animateShape](/jetpack-compose/androidx.xr.glimmer/glimmer/objects/IconToggleButtonDefaults),
which uses default Glimmer animations and shapes, or consider creating a custom animated
shape.

#### Parameters

| | |
| --- | --- |
| checked | whether the button is in the checked state |
| checkedShape | the shape of the button when it is checked |
| uncheckedShape | the shape of the button when it is unchecked |

### animateShape

```kotlin
@Composable
public fun animateShape(checked: Boolean): Shape
```

Provides a [Shape](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/Shape) that uses the default Glimmer shapes for buttons and animates transitions
between states. If you require an animated transition between your own custom shapes, please
consider creating a custom animated shape.

#### Parameters

| | |
| --- | --- |
| checked | whether the button is in the checked state |

### colors

```kotlin
@Composable
public fun colors(
    backgroundColor: Color = GlimmerTheme.colors.surface,
    checkedBackgroundColor: Color = GlimmerTheme.colors.outline,
    contentColor: Color = calculateContentColor(backgroundColor),
    checkedContentColor: Color = calculateContentColor(checkedBackgroundColor),
): IconToggleButtonColors
```

Creates [IconToggleButtonColors](/jetpack-compose/androidx.xr.glimmer/glimmer/classes/IconToggleButtonColors) with default values for an [IconToggleButton](/jetpack-compose/androidx.xr.glimmer/glimmer/components/IconToggleButton).

#### Parameters

| | |
| --- | --- |
| backgroundColor | The background color when the button is unchecked. |
| checkedBackgroundColor | The background color when the button is checked. |
| contentColor | The content color when the button is unchecked. |
| checkedContentColor | The content color when the button is checked. |
