Skip to content

Android components Forms

StanceSwitch

Beta

A switch with its label for settings that apply immediately.

  • PlatformAndroid, Jetpack Compose
  • Builds onSwitch
  • Kindcomposable

Preview

Rendered by the Jetpack Compose library, not drawn by hand.

StanceSwitch on AndroidStanceSwitch on AndroidStanceSwitch on Android
StanceSwitch, Light appearance
Light
StanceSwitch, Dark appearance
Dark
StanceSwitch, High contrast appearance
High contrast

Usage

kotlin
var enabled by remember { mutableStateOf(true) }
StanceSwitch("Apply to new members automatically", enabled, { enabled = it })

Accessibility

  • Touch target is at least 48dp.
  • Announced as a switch with On or Off.

On other platforms