Skip to main content
Child windows are self-contained scrolling/clipping regions within a parent window. They’re useful for creating complex layouts with independent scroll areas, embedding panels, and organizing content.

BeginChild (String ID)

Creates a child window with a string identifier.

Parameters

const char*
required
Unique identifier for the child window within the parent.
const ImVec2&
default:"ImVec2(0, 0)"
Child window size. Per axis: 0.0f = use remaining parent size, >0.0f = specified size, <0.0f = use remaining minus specified value.
ImGuiChildFlags
default:"0"
Child-specific flags (borders, auto-resize, etc.). Before v1.90, this was a bool border parameter.
ImGuiWindowFlags
default:"0"
Standard window flags (scrollbars, input handling, etc.).

Returns

bool
Returns false if the child window is collapsed or fully clipped. You must still call EndChild() regardless.

Description

Child windows:
  • Create independent scrolling/clipping regions
  • Can contain any widgets including other child windows
  • Inherit parent window’s font and style
  • Can have borders, auto-resize, and custom backgrounds

Example

Before v1.90: The third parameter was bool border. This API is backward compatible:
  • BeginChild("Name", size, false)BeginChild("Name", size, 0)
  • BeginChild("Name", size, true)BeginChild("Name", size, ImGuiChildFlags_Borders)
Update your old code for clarity.

BeginChild (ImGuiID)

Creates a child window with a numeric identifier.

Parameters

ImGuiID
required
Unique numeric identifier for the child window. Useful when generating children in loops.
const ImVec2&
default:"ImVec2(0, 0)"
Child window size.
ImGuiChildFlags
default:"0"
Child-specific flags.
ImGuiWindowFlags
default:"0"
Standard window flags.

Example

EndChild

Ends the current child window.

Description

Must be called for every BeginChild(), regardless of return value.

Example

Like Begin/End, you must always call EndChild() even if BeginChild() returns false. This inconsistency exists for legacy reasons and will be fixed in a future update.

Child Window Sizing

Manual Sizing

Auto-Resize

Combining ImGuiChildFlags_AutoResizeX and ImGuiChildFlags_AutoResizeY defeats the purpose of a scrolling region and is not recommended. The child will grow infinitely with content.

Common Use Cases

Split Panels

Scrollable Content Area

Game Inventory

Console/Log Window

Nested Children

Performance Considerations