ImGuiWindow:CollapsingHeader Asynchronous

Group controls beneath a heading that can be collapsed. Add the group’s children in the content callback; collapsing later hides those existing controls.

Syntax
Luau
ImGuiWindow:CollapsingHeader(
    label: string,
    contentCallback: (ImGuiWindow) -> ()
) -> ImGuiWindow

Parameters

Call this method with a ImGuiWindow receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.

Function parameters
ParameterTypeDescription
labelstringHeading shown on the toggle.
contentCallback(ImGuiWindow) -> ()Function receiving the same ImGuiWindow handle for adding group content.

Returns

ImGuiWindow

The same ImGuiWindow handle, so more controls can be added with another method call.

Usage notes

The content callback is called while the group is built, through pcall. Its return value is ignored; expanding the group later does not rerun it.

Example

Example
Luau
local window = imgui.create("Example controls")
window:CollapsingHeader("Appearance", function(group)
    group:Text("Preview settings")
    group:Checkbox("Show border", true, function(checked)
        print("Border:", checked)
    end)
end)
Kawaii documentation