public sealed class Switch : Widget, Accessible, Actionable, Buildable, ConstraintTarget
`GtkSwitch` is a "light switch" that has two states: on or off.
![An example GtkSwitch](switch.png)
The user can control which state should be active by clicking the empty area, or by dragging the handle.
`GtkSwitch` can also handle situations where the underlying state changes with a delay. In this case, the slider position indicates the user's recent change (as indicated by the [property@Gtk.Switch:active] property), and the color indicates whether the underlying state (represented by the [property@Gtk.Switch:state] property) has been updated yet.
![GtkSwitch with delayed state change](switch-state.png)
GtkSwitch:state-set] for details.
``` switch ├── label ├── label ╰── slider ```
`GtkSwitch` has four css nodes, the main node with the name switch and subnodes for the slider and the on and off labels. Neither of them is using any style classes.
`GtkSwitch` uses the gtk_accessible_role_switch role.