Object

SwitchDefaults

Contains the default values used by Switch.

Source set: Android
public object SwitchDefaults

Contains the default values used by Switch.

Functions

colors

Source set: Android
@Composable
    public fun colors(
        checkedThumbColor: ColorProvider,
        uncheckedThumbColor: ColorProvider,
        checkedTrackColor: ColorProvider,
        uncheckedTrackColor: ColorProvider,
    ): SwitchColors

SwitchColors to tint the thumb and track of the Switch according to the checked state.

Parameters

checkedThumbColor the tint to apply to the thumb of the switch when it is checked
uncheckedThumbColor the tint to apply to the thumb of the switch when it is not checked
checkedTrackColor the tint to apply to the track of the switch when it is checked
uncheckedTrackColor the tint to apply to the track of the switch when it is not checked

colors

Source set: Android
@Composable
    public fun colors(): SwitchColors

SwitchColors to tint the thumb and track of the Switch according to the checked state.

Return

a default set of SwitchColors.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: