Toggle

toggle

Toggle is a switcher between two states. Most common toggles are used to switch between as on/off in preferences or settings.

Usage

toggle

XelaToggle() {
    Text("Label", style = xelaBody)
}

Properties XelaToggleStyle

Name Type Default Value Required Description
icon Int? null NO Icon name from Drawable on toggle
onToggleChange (item: Boolean) -> Unit {} On toggle change action
size XelaToggleSize XelaToggleSize.LARGE NO Toggle size (LARGE, MEDIUM, LOW)
onBackgound Color XelaColor.Blue3 NO Toggle ON background
offBackground Color XelaColor.Gray11 NO Toggle OFF background
iconOnColor Color XelaColor.Blue3 NO Toggle ON icon color
iconOffColor Color XelaColor.Gray8 NO Toggle OFF icon color
circleOnColor Color Color.White NO Toggle ON circle color
circleOffColor Color Color.White NO Toggle OFF circle color
selected Boolean false NO Toggle is checked
content (@Composable RowScope.() -> Unit)? null NO Toggle content