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

# Toggle

> Switch a boolean on and off.

A toggle flips a boolean. `CreateSwitch` is an alias for the same element.

<Frame>
  <img src="https://mintcdn.com/sirius-b451bfde/f6FV7zSG5WdJNsXv/images/gen2/window.png?fit=max&auto=format&n=f6FV7zSG5WdJNsXv&q=85&s=0d854c97a34521ebb3314eef4dd96d25" alt="Toggle elements, one on and one off" width="705" height="730" data-path="images/gen2/window.png" />
</Frame>

```lua theme={null}
local sprint = tab:CreateToggle({
    name = "Auto Sprint",
    flag = "AutoSprint",
    value = true,
    callback = function(value)
        print("Auto Sprint:", value)
    end,
})

sprint:Set(false)
```

## Properties

<ResponseField name="name" type="string">
  The label.
</ResponseField>

<ResponseField name="description" type="string">
  Hint text under the label. Optional.
</ResponseField>

<ResponseField name="icon" type="string | number">
  An icon shown beside the label. Optional.
</ResponseField>

<ResponseField name="value" type="boolean" default="false">
  The initial state.
</ResponseField>

<ResponseField name="flag" type="string" default="name">
  The save key. Optional.
</ResponseField>

<ResponseField name="forgetState" type="boolean" default="false">
  Skip saving.
</ResponseField>

<ResponseField name="callback" type="function">
  Runs with the new value on every change.
</ResponseField>

## Handle

<ResponseField name=".value" type="boolean">
  The current state.
</ResponseField>

<ResponseField name="Set(value, skipCallback?)">
  Set the state. Pass `true` as the second argument to skip the callback.
</ResponseField>
