Groups and search
Collapsible containers, per-section filtering, and window-wide search.
Groups#
A group is a container that opens and closes. Everything you put inside it goes away when it is shut.
local advanced = main:Group({ Text = "Advanced", Icon = "wrench", Open = false })
advanced:Toggle({ Text = "Debug logging" })
advanced:Slider({ Text = "Tick rate", Min = 1, Max = 60, Default = 30 })My Script
v1.0
A group has the same methods a section does, so anything you can add to a
section you can add to a group. It also has Show, Hide and Destroy, like
any other row on the page.
Opening one scrolls it into view, the same as an opening dropdown, so a group near the bottom of a long page does not expand into space you cannot see.
| Option | Type | Default | What it does |
|---|---|---|---|
Textreq | string | — | The group's heading. |
Description | string | — | A quieter line beside the heading. |
Icon | string | — | An icon before the heading. |
IconSize | number | 13 | Read only when Icon is set. |
IconColor | Color3 | — | Read only when Icon is set. Defaults to the muted role. |
Open | boolean | true | Whether it starts expanded. |
LayoutOrder | number | — | Places it explicitly instead of in creation order. |
Tooltip | string | — | Shown while the pointer rests on the header. |
Disabled | boolean | false | Locks the group and everything in it. |
DisabledReason | string | — | Shown as a tooltip while it is locked. |
| Method | Returns | What it does |
|---|---|---|
SetOpen(state, animated) | the group | Opens or closes it. Pass false as the second argument to skip the animation. |
Open() / Close() | the group | The same thing, named |
IsOpen() | boolean | Whether it is currently open |
Show() / Hide() / SetVisible(v) | the group | Takes it off the page without destroying it |
Destroy() | true | Removes it and everything in it |
SetDisabled(state, reason?) | the group | Locks or unlocks it |
Disable(reason?) / Enable() | the group | The same thing, named |
IsDisabled() | boolean | Whether it is locked |
SetTooltip(text) | the group | Changes the hover text |
.Instance | Frame | The container itself |
advanced:SetOpen(true) -- animates open
advanced:SetOpen(false, false) -- snaps shut, no animation
advanced:Hide() -- gone from the page, still builtThe container follows its contents. A dropdown opening inside it, or a description that wraps to a second line, re-targets the group's height while it is open.
Controls inside a group render flat
A group draws its own surface, so the controls inside it drop theirs. Pass
Flat = false on a control to give it its card back.
Locking a group#
Disabled fades everything inside the container and stops it accepting input,
not only the header:
local advanced = main:Group({
Text = "Advanced",
Icon = "wrench",
Disabled = true,
DisabledReason = "Available once you are in a game",
})
advanced:Toggle({ Text = "Debug logging" })
advanced:Enable() -- and everything inside comes back with itMy Script
v1.0
Controls added after the lock are locked too, which is the usual order: the
group is built with Disabled = true and filled in on the next line.
Per-section search#
Turn on a filter box for one section:
local big = win:Section("Everything", "list", {
Search = true,
SearchPlaceholder = "Filter this section…",
})The box sits at the top of the section and is never filtered away itself.
SearchPlaceholder defaults to Search <section name>….
Typing filters the controls in that section. A control matches on its Text and
Description, and on the heading of the group it sits in, so typing a group's
name keeps everything inside it. Matching is case-insensitive and looks for the
query anywhere in the text.
A group whose contents all fail the filter hides itself. So does a Title with
nothing visible under it, along with the separators that trail it.
A search overrides Hide
Filtering decides a group's visibility from whether anything inside it matches,
so a group you hid with Hide() comes back if the query matches one of its
rows. Clearing the query hides it again.
Window-wide search#
The rail can carry its own search box that spans every section:
local win = Ember.new({
Title = "My Script",
Search = true,
SearchPlaceholder = "Search...",
})Matches are counted per section and shown next to each tab, in the accent colour when the count is above zero. If the section you are on has no matches and another does, Ember selects the first section that has some.
It is off by default, and turning it on takes 40px off the top of the tab list.
The two boxes combine. With both in use, a row has to match the window query and the section query to stay on the page.
Which to use#
| Situation | Reach for |
|---|---|
| One section with a lot of rows | Per-section Search |
| Many sections, user does not know where a setting lives | Window Search |
| A block of rarely-touched options | A Group, closed by default |
| Two or three related rows | A Title and a Separator |