Input

SKSwitch

SKSwitch is the preference toggle for settings surfaces. It animates thumb and track independently and supports an icon inside the thumb for state clarity in high-contrast mode.

Betasince 1.6.0Compose · XMLAll components

Not yet released. SKSwitch is planned for 1.6.0; the current published release (1.4.0-alpha01) ships SKText and SKTextField only.

Usage

SKSwitch.kt
SKSwitch(
    checked = syncEnabled,
    onCheckedChange = { syncEnabled = it },
    thumbIcon = SKIcons.Check
)

Props

PropTypeDefaultDescription
checkedBooleanfalseToggle state.
onCheckedChange(Boolean) -> Unit—State callback.
thumbIconSKIcon?nullOptional icon drawn inside the thumb.

Accessibility

Announces on/off state, honours reduced-motion, 48dp target.

Theming

Track and thumb colours pair from SKTheme.colors.

API surface

  • SKSwitch

Related