> For the complete documentation index, see [llms.txt](https://uis.gitbook.io/turtle-library/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uis.gitbook.io/turtle-library/api-reference/toggle/example.md).

# Example

<pre class="language-lua"><code class="lang-lua">-- Note: This is just a snippet
<strong>Window:Toggle("Toggle: off", false, function(State, Func)
</strong>    print("Toggle:", State)
    Func.State = State and "Toggle: on" or "Toggle: off"
end)
</code></pre>

```lua
-- Note: This is just a snippet
Window:Toggle({
    Text = "Toggle: off",
    Callback = function(State, Func)
        print("Toggle:", State)
        Func.State = State and "Toggle: on" or "Toggle: off"
    end
})
```
