Switch

A component that toggles between 2 states: on & off.

  • Its size is locked down to 52dp x 32dp; this is done in the SDK and cannot be modified.
Compose Multiplatform

Thumb Customizations

You can customize the thumb by passing a composable to thumbContent. This example uses an Icon as the thumb.

  • The size of the thumb in its unchecked state will grow to fill its parent if it is larger than 0dp.
  • SwitchDefaults.IconSize defaults to 16dp, but it can go up to a max of 24dp.
Compose Multiplatform

Color Customizations

Colors can be customized via SwitchDefaults.colors().

Compose Multiplatform