ElementsControls
AddToggle
Adds an on/off control with optional saving, keybind, locking, and settings integration.
AddToggle
What it does
Adds an on/off control with optional saving, keybind, locking, and settings integration.
When to use it
Use it for any boolean feature that the user should enable or disable.
ElementFunction:AddToggle(ToggleConfig)
RightQuickMenu:AddToggle({
Name = "Animated Window",
Default = true,
Callback = function(value)
print("Animated Window", value)
end
})Behavior and return value
Call this method on the compatible section, tab, panel, or element container shown by the signature. Store the returned value when you need to update, read, or destroy the element later.
Fields marked optional may be omitted. XLQP then uses the method’s built-in default or leaves that feature disabled.