Switch¶
Simple styled switch control suitable for toggling boolean settings.
Renders the themed trackTexture state - a combined checked+hovered state is used when both apply and the theme defines it - with the themed thumbTexture drawn on top, animating between its off/on positions.
Parameters¶
-
checked: The current checked state.
-
onCheckedChange: Called with the new checked value when the user clicks.
-
modifier: Additional modifiers applied to the outer container.
-
enabled: When
false, pointer events are ignored and theTextureStates.DISABLEDstate is shown. -
trackTexture: The themed texture key for the track, looked up via
LocalTheme. -
thumbTexture: The themed texture key for the thumb, looked up via
LocalTheme. -
variant: The theme variant of both textures to use. See
ThemeVariants.