Controls overview
All thirteen controls, the options every one shares, and how handles work.
Every control is a method on a section, takes one options table, and returns a handle. That is the whole API surface.
local handle = section:Toggle({ Text = "Enabled", Callback = print })The thirteen#
Runs a function. Four visual styles, hover and click animations.
ToggleOn or off. The one you will use most.
SliderA number in a range, with steps and a unit suffix.
InputA text field, firing per keystroke or on blur.
DropdownPick one, or many. Searchable, with three selection styles.
KeybindCaptures a key and calls you when it is pressed.
ColorPickerA full HSV picker in a dropdown.
PaletteA fixed row of swatches, when a full picker is overkill.
IconButtonA row of small square buttons.
StatusRead-only text you update from code.
TitleA heading inside a section.
DescriptionA paragraph of explanatory text.
SeparatorA dividing line.
Options every control shares#
These work on any control. Anything a control adds on top is documented on its own page.
| Option | Type | Default | What it does |
|---|---|---|---|
Text | string | — | The label. Non-strings are coerced, so a number is safe. |
Description | string | — | A second, quieter line beneath the label. |
Icon | string | — | One of the 1,573 built-in icon names. |
IconColor | Color3 | — | Overrides the icon colour for this control only. |
IconSize | number | — | Icon size in pixels. Defaults to the control's natural size. |
LayoutOrder | number | — | Explicit ordering. Without it, controls appear in creation order. |
Flat | boolean | false | Removes the card background. Applied automatically to controls inside a Group. |
Handles#
Stateful controls return a handle with Get and Set:
local speed = main:Slider({ Text = "Speed", Min = 0, Max = 100, Default = 50 })
speed:Get() --> 50
speed:Set(80) --> updates the UI and fires CallbackSet fires the callback
Set is not a silent write — it behaves exactly as though the user moved the
control. That is usually what you want (one code path, not two), but it means
calling Set inside that control's own Callback will loop.
Some controls add more. A dropdown, for example:
| Method | What it does |
|---|---|
Get() | Current value — a string, or an array when Multi |
Set(value) | Selects a value or list of values |
SetOptions(list) | Replaces the option list in place |
Open() / Close() / IsOpen() | Controls the menu |
Show() / Hide() / SetVisible(bool) | Shows or hides the whole control |
Destroy() | Removes it from the page |
Callbacks#
Callback fires whenever the value changes, with the new value as its only
argument:
main:Toggle({
Text = "Godmode",
Callback = function(enabled) -- boolean
print("godmode:", enabled)
end,
})
main:Slider({
Text = "FOV", Min = 70, Max = 120,
Callback = function(value) -- number
workspace.CurrentCamera.FieldOfView = value
end,
})
main:Dropdown({
Text = "Target", Options = { "Nearest", "Lowest HP" },
Callback = function(choice) -- string
targetMode = choice
end,
})By default a callback does not fire when the control is created. If you
want it to — to apply a saved value on startup — use FireOnStart:
main:Toggle({
Text = "Fullbright",
Save = "fullbright",
FireOnStart = true, -- applies the restored value immediately
Callback = function(on) setFullbright(on) end,
})Organising a long section#
Two tools stop a section becoming a wall of rows:
Headings break it into runs:
main:Title({ Text = "COMBAT", Icon = "crosshair" })
main:Description("These only apply in a round.")
-- controls…
main:Separator()
main:Title({ Text = "MOVEMENT", Icon = "compass" })Groups collapse:
local advanced = main:Group({ Text = "Advanced", Icon = "wrench", Open = false })
advanced:Toggle({ Text = "Debug logging" })
advanced:Slider({ Text = "Tick rate", Min = 1, Max = 60 })A group is a container that grows and shrinks. Controls inside one render flat, because the group already draws the surface. See Groups and search.
See them running#
Every control page carries a live preview like this one. It is the real control, working, and the dropdown in its corner repaints it into any of the nine built-in themes.
My Script
v1.0
Enabled
FireOnStart runs the callback once at build time.
Speed
Mode
Filter
Panic key
Status