ToggleButtonDefaults

object ToggleButtonDefaults


Contains the default values used by ToggleButton.

Summary

Public functions

@Composable ToggleButtonColors
toggleButtonColors(
    checkedBackgroundColor: Color,
    checkedContentColor: Color,
    disabledCheckedBackgroundColor: Color,
    disabledCheckedContentColor: Color,
    uncheckedBackgroundColor: Color,
    uncheckedContentColor: Color,
    disabledUncheckedBackgroundColor: Color,
    disabledUncheckedContentColor: Color
)

Creates a ToggleButtonColors that represents the background and content colors used in a ToggleButton.

Public properties

Dp

The default size applied for the ToggleButton.

Dp

The recommended size for a small ToggleButton.

Public functions

toggleButtonColors

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

Creates a ToggleButtonColors that represents the background and content colors used in a ToggleButton. Defaults to primary-styled checked colors and surface-styled unchecked colors.

Parameters
checkedBackgroundColor: Color = MaterialTheme.colors.primary

the background color of this ToggleButton when enabled and checked

checkedContentColor: Color = contentColorFor(checkedBackgroundColor)

the content color of this ToggleButton when enabled and checked

disabledCheckedBackgroundColor: Color = checkedBackgroundColor.copy(alpha = ContentAlpha.disabled)

the background color of this ToggleButton when checked and not enabled

disabledCheckedContentColor: Color = checkedContentColor.copy(alpha = ContentAlpha.disabled)

the content color of this ToggleButton when checked and not enabled

uncheckedBackgroundColor: Color = MaterialTheme.colors.surface

the background color of this ToggleButton when enabled and unchecked

uncheckedContentColor: Color = contentColorFor(uncheckedBackgroundColor)

the content color of this ToggleButton when enabled and unchecked

disabledUncheckedBackgroundColor: Color = uncheckedBackgroundColor.copy(alpha = ContentAlpha.disabled)

the background color of this ToggleButton when unchecked and not enabled

disabledUncheckedContentColor: Color = uncheckedContentColor.copy(alpha = ContentAlpha.disabled)

the content color of this ToggleButton when unchecked and not enabled

Public properties

DefaultToggleButtonSize

val DefaultToggleButtonSizeDp

The default size applied for the ToggleButton. Note that you can override it by applying Modifier.size directly on ToggleButton.

SmallToggleButtonSize

val SmallToggleButtonSizeDp

The recommended size for a small ToggleButton. You can apply this value for the size by overriding Modifier.size directly on ToggleButton.