ToggleChipDefaults

object ToggleChipDefaults


Contains the default values used by ToggleChips and SplitToggleChips

Summary

Public functions

ImageVector

Creates checkbox style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip.

ImageVector
radioIcon(checked: Boolean)

Creates a radio button style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip.

SplitToggleChipColors
@Composable
splitToggleChipColors(
    backgroundColor: Color,
    contentColor: Color,
    secondaryContentColor: Color,
    checkedToggleControlColor: Color,
    uncheckedToggleControlColor: Color,
    splitBackgroundOverlayColor: Color
)

Creates a SplitToggleChipColors for use in a SplitToggleChip.

ImageVector
switchIcon(checked: Boolean)

Creates switch style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip.

ToggleChipColors
@Composable
toggleChipColors(
    checkedStartBackgroundColor: Color,
    checkedEndBackgroundColor: Color,
    checkedContentColor: Color,
    checkedSecondaryContentColor: Color,
    checkedToggleControlColor: Color,
    uncheckedStartBackgroundColor: Color,
    uncheckedEndBackgroundColor: Color,
    uncheckedContentColor: Color,
    uncheckedSecondaryContentColor: Color,
    uncheckedToggleControlColor: Color,
    gradientDirection: LayoutDirection
)

Creates a ToggleChipColors for use in a ToggleChip.

Public properties

ImageVector
PaddingValues

The default content padding used by ToggleChip and SplitToggleChip

Dp

The default height applied for the ToggleChip or SplitToggleChip.

Dp

The default size of app icons or toggle controls when used inside a ToggleChip or SplitToggleChip.

ImageVector
ImageVector
Color

The Wear Material UX recommended color to use for an unchecked switch icon.

Public functions

checkboxIcon

Added in 1.0.0
fun checkboxIcon(checked: Boolean): ImageVector

Creates checkbox style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip. Depending on checked will return either an 'on' (ticked/checked) or 'off' (unticked/unchecked) checkbox image.

Parameters
checked: Boolean

whether the ToggleChip or SplitToggleChip is currently 'on' (checked/true) or 'off' (unchecked/false)

radioIcon

Added in 1.0.0
fun radioIcon(checked: Boolean): ImageVector

Creates a radio button style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip. Depending on checked will return either an 'on' (checked) or 'off' (unchecked) radio button icon.

Parameters
checked: Boolean

whether the ToggleChip or SplitToggleChip is currently 'on' (checked/true) or 'off' (unchecked/false)

splitToggleChipColors

@Composable
fun splitToggleChipColors(
    backgroundColor: Color = MaterialTheme.colors.surface,
    contentColor: Color = MaterialTheme.colors.onSurface,
    secondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant,
    checkedToggleControlColor: Color = MaterialTheme.colors.secondary,
    uncheckedToggleControlColor: Color = contentColor,
    splitBackgroundOverlayColor: Color = Color.White.copy(alpha = 0.05f)
): SplitToggleChipColors

Creates a SplitToggleChipColors for use in a SplitToggleChip.

Parameters
backgroundColor: Color = MaterialTheme.colors.surface

The background color of this SplitToggleChip when enabled

contentColor: Color = MaterialTheme.colors.onSurface

The content color of this SplitToggleChip when enabled.

secondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant

The secondary content color of thisSplitToggleChip when enabled

checkedToggleControlColor: Color = MaterialTheme.colors.secondary

The toggle control content color of this SplitToggleChip when enabled.

uncheckedToggleControlColor: Color = contentColor

The toggle control content color of this SplitToggleChip when enabled.

splitBackgroundOverlayColor: Color = Color.White.copy(alpha = 0.05f)

The color to use to lighten/distinguish the background behind the ToggleControl for a split background chip. A split background chip has two tappable areas, one for the main body of the chip and one for area around the toggle control icon.

switchIcon

Added in 1.0.0
fun switchIcon(checked: Boolean): ImageVector

Creates switch style toggle ImageVectors for use in the toggleControl slot of a ToggleChip or SplitToggleChip. Depending on checked will return either an 'on' (checked) or 'off' (unchecked) switch icon.

Parameters
checked: Boolean

whether the ToggleChip or SplitToggleChip is currently 'on' (checked/true) or 'off' (unchecked/false)

toggleChipColors

@Composable
fun toggleChipColors(
    checkedStartBackgroundColor: Color = MaterialTheme.colors.surface .copy(alpha = 0f) .compositeOver(MaterialTheme.colors.surface),
    checkedEndBackgroundColor: Color = MaterialTheme.colors.primary .copy(alpha = 0.5f) .compositeOver(MaterialTheme.colors.surface),
    checkedContentColor: Color = MaterialTheme.colors.onSurface,
    checkedSecondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant,
    checkedToggleControlColor: Color = MaterialTheme.colors.secondary,
    uncheckedStartBackgroundColor: Color = MaterialTheme.colors.surface,
    uncheckedEndBackgroundColor: Color = uncheckedStartBackgroundColor,
    uncheckedContentColor: Color = contentColorFor(checkedEndBackgroundColor),
    uncheckedSecondaryContentColor: Color = uncheckedContentColor,
    uncheckedToggleControlColor: Color = uncheckedContentColor,
    gradientDirection: LayoutDirection = LocalLayoutDirection.current
): ToggleChipColors

Creates a ToggleChipColors for use in a ToggleChip. ToggleChips are expected to have a linear gradient background when checked, similar to a ChipDefaults.gradientBackgroundChipColors and a solid neutral background when not checked (similar to a ChipDefaults.secondaryChipColors)

Parameters
checkedStartBackgroundColor: Color = MaterialTheme.colors.surface .copy(alpha = 0f) .compositeOver(MaterialTheme.colors.surface)

The background color used at the start of the gradient of a ToggleChip when enabled and checked.

checkedEndBackgroundColor: Color = MaterialTheme.colors.primary .copy(alpha = 0.5f) .compositeOver(MaterialTheme.colors.surface)

The background color used at the end of the gradient of a ToggleChip when enabled and checked.

checkedContentColor: Color = MaterialTheme.colors.onSurface

The content color of a ToggleChip when enabled and checked.

checkedSecondaryContentColor: Color = MaterialTheme.colors.onSurfaceVariant

The secondary content color of this ToggleChip when enabled and checked, used for secondaryLabel content

checkedToggleControlColor: Color = MaterialTheme.colors.secondary

The toggle control color of this ToggleChip when enabled and checked, used for toggleControl content

uncheckedStartBackgroundColor: Color = MaterialTheme.colors.surface

The background color used at the start of the gradient of a ToggleChip when enabled and unchecked.

uncheckedEndBackgroundColor: Color = uncheckedStartBackgroundColor

The background color used at the end of the gradient of a ToggleChip when enabled and unchecked.

uncheckedContentColor: Color = contentColorFor(checkedEndBackgroundColor)

The content color of a ToggleChip when enabled and checked.

uncheckedSecondaryContentColor: Color = uncheckedContentColor

The secondary content color of this ToggleChip when enabled and unchecked, used for secondaryLabel content

uncheckedToggleControlColor: Color = uncheckedContentColor

The toggle control color of this ToggleChip when enabled and unchecked.

gradientDirection: LayoutDirection = LocalLayoutDirection.current

Whether the chips gradient should be start to end (indicated by LayoutDirection.Ltr) or end to start (indicated by LayoutDirection.Rtl).

Public properties

CheckboxOn

Added in 1.0.0
val CheckboxOnImageVector

ContentPadding

Added in 1.0.0
val ContentPaddingPaddingValues

The default content padding used by ToggleChip and SplitToggleChip

Height

Added in 1.4.0
val HeightDp

The default height applied for the ToggleChip or SplitToggleChip. Note that you can override it by applying Modifier.heightIn directly on ToggleChip or SplitToggleChip.

IconSize

Added in 1.0.0
val IconSizeDp

The default size of app icons or toggle controls when used inside a ToggleChip or SplitToggleChip.

RadioOff

Added in 1.0.0
val RadioOffImageVector

RadioOn

Added in 1.0.0
val RadioOnImageVector

SwitchUncheckedIconColor

Added in 1.0.0
val SwitchUncheckedIconColorColor

The Wear Material UX recommended color to use for an unchecked switch icon.