ImGuiWindow:CollapsingHeader Asynchronous

Create a collapsible content group and populate it through a callback. Use it to keep optional settings together without filling the entire window. Add that group’s controls inside the content callback.

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
labelstringLabel on the collapsible header.
contentCallback(ImGuiWindow) -> ()Receives an ImGuiWindow handle for adding the group’s content.

Returns

ImGuiWindow

The same ImGuiWindow, allowing another window method to be chained.

Usage notes

The content callback runs through pcall and may yield. Its return value is discarded.

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