> ## Documentation Index
> Fetch the complete documentation index at: https://neo.tvk.company/llms.txt
> Use this file to discover all available pages before exploring further.

# Toggle Switch

> A switch control that allows users to toggle between on and off states with smooth animations and intuitive interactions.

## Examples

<Frame caption="Toggle switch with on and off states.">
  <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/controls/toggle-switch/toggle_switch_light.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=487d22e6b59f6afe9052b1b45c59dd80" alt="Toggle switch example" noZoom className="block dark:hidden" width="1536" height="384" data-path="images/widgets/controls/toggle-switch/toggle_switch_light.png" />

  <img src="https://mintcdn.com/tvk/xOcwrKRVA4J0vbxn/images/widgets/controls/toggle-switch/toggle_switch_dark.png?fit=max&auto=format&n=xOcwrKRVA4J0vbxn&q=85&s=f6b1893b3d68e1ff886770793972e019" alt="Toggle switch example" noZoom className="hidden dark:block" width="1536" height="384" data-path="images/widgets/controls/toggle-switch/toggle_switch_dark.png" />
</Frame>

<CodeGroup>
  ```dart Off State lines theme={null}
  NeoToggleSwitch(
    isOn: false,
    onChanged: (value) {
      // Handle state change
    },
  ),
  ```

  ```dart On State lines theme={null}
  NeoToggleSwitch(
    isOn: true,
    onChanged: (value) {
      // Handle state change
    },
  ),
  ```
</CodeGroup>

## Properties

### Required

<ParamField path="isOn" type="bool" required>
  The current state of the toggle switch. `true` represents the "on" state, `false` represents the "off" state.
</ParamField>

<ParamField path="onChanged" type="ValueChanged<bool>" required>
  Callback function called when the toggle state changes. Receives the new boolean value.
</ParamField>

### State

<ParamField path="isEnabled" type="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.
</ParamField>

## Best Practices

* Combine with [`NeoHaptics`](/utilities/haptics) 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
