Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Footagesus/WindUI/llms.txt

Use this file to discover all available pages before exploring further.

Add a toggle or checkbox to a tab by calling :Toggle({...}). The returned object lets you read and set the current value programmatically.

Parameters

Title
string
Label displayed next to the control. Defaults to "Toggle" when omitted.
Desc
string
Secondary line of text rendered beneath the title.
Icon
string
Lucide icon name shown inside the toggle knob when the element is on.
Type
"Toggle" | "Checkbox"
default:"\"Toggle\""
Visual style. "Toggle" renders a sliding pill. "Checkbox" renders a square checkbox with a checkmark icon.
Value
boolean
default:"false"
Initial state of the control.
Flag
string
Identifier used by the config system to save and restore this element’s value between sessions.
Locked
boolean
When true, the control is overlaid with a lock indicator and the callback is suppressed.
LockedTitle
string
Custom text shown on the lock overlay. Defaults to "Locked".
Callback
function(state: boolean)
Called whenever the value changes. Receives the new boolean state.

Methods

Programmatically sets the toggle state. The callback fires unless the element is locked.
local myToggle = Tab:Toggle({
  Title = "Toggle Panel Background",
  Value = true,
  Callback = function(state)
    Window:SetPanelBackground(state)
  end,
})

-- Turn off from another button
Tab:Button({
  Title = "Disable",
  Callback = function()
    myToggle:Set(false)
  end,
})

Examples

Basic toggle

Tab:Toggle({
  Title = "Toggle",
  Callback = function(state)
    print("Toggle state:", state)
  end,
})

Toggle with description

Tab:Toggle({
  Title = "Toggle",
  Desc = "Toggle example",
  Callback = function(state)
    print("Toggle state:", state)
  end,
})

Checkbox type

Tab:Toggle({
  Title = "Checkbox",
  Type = "Checkbox",
  Callback = function(state)
    print("Checkbox state:", state)
  end,
})

Checkbox with description

Tab:Toggle({
  Title = "Checkbox",
  Desc = "Checkbox example",
  Type = "Checkbox",
  Callback = function(state)
    print("Checkbox state:", state)
  end,
})

Locked toggle

Tab:Toggle({
  Title = "Toggle",
  Locked = true,
  LockedTitle = "This element is locked",
})

Group with toggles

Toggles placed in a group render flush against each other with shared rounding.
local Group = Tab:Group()

Group:Toggle({
  Title = "Toggle 1",
  Callback = function(v) print("Toggle 1:", v) end,
})
Group:Space()
Group:Toggle({
  Title = "Toggle 2",
  Callback = function(v) print("Toggle 2:", v) end,
})

Toggle with Flag (config saving)

Tab:Toggle({
  Flag = "ToggleTest",
  Title = "Toggle",
  Desc = "Toggle Description",
  Value = false,
  Callback = function(state)
    print("Toggle Activated:", tostring(state))
  end,
})

Build docs developers (and LLMs) love