Toggle
Carbon Toggle
A toggle is used to quickly switch between two possible states. They are commonly used for “on/off” switches.
Content
The toggle itself with a handle that indicates the current state.
The label accompanying the toggle to further clarify the action that the toggle performs.
The action text describing the binary action of toggle so that the action is clear.
Interactions
The component applies a toggleable interaction to the toggle root composable if the onToggleChange callback is provided, meaning that the whole component is clickable in order to create a more accessible click target. Otherwise, the toggle won't be interactable.
(From Toggle documentation)
Parameters
Whether the toggle is toggled on or off.
Callback for when the toggle is toggled.
Modifier to be applied to the toggle.
Label text to be displayed above the toggle.
Action text to be displayed next to the toggle.
Whether the toggle is enabled.
Whether the toggle is read only.
The MutableInteractionSource to be applied to the toggle.