Skip to main content

Examples

Toggle switch example

Toggle switch with on and off states.

Properties

Required

bool
required
The current state of the toggle switch. true represents the “on” state, false represents the “off” state.
ValueChanged<bool>
required
Callback function called when the toggle state changes. Receives the new boolean value.

State

bool
default:"true"
Controls whether the toggle switch is interactive. When false, the switch dims, ignores input and focus, and shows a forbidden cursor while still displaying its current on/off state.

Best Practices

  • Combine with NeoHaptics in the onChanged callback for enhanced user experience on supported devices.

Integration Notes

  • Input Methods: Supports both tap and drag interactions:
    • Tap: Single tap anywhere on the switch toggles the state
    • Drag: Horizontal drag allows intuitive dragging to toggle
Last modified on October 10, 2025