Skip to main content
Combo boxes (dropdowns) and list boxes provide ways for users to select from a list of options. Dear ImGui offers both simple helper functions and flexible BeginCombo/EndCombo APIs.

Combo Boxes

BeginCombo() / EndCombo()

Manually control combo box contents:
const char*
required
Widget label
const char*
required
Text displayed in the combo box before opening
ImGuiComboFlags
Optional combo flags (see below)
Only call EndCombo() if BeginCombo() returns true!

Simple Combo() Functions

Convenience wrappers for common use cases:

Combo Flags

Height

Button Style

Combo with Search Filter

Add filtering to combo box contents:

List Boxes

BeginListBox() / EndListBox()

Create a scrollable list:
ImVec2
  • size.x > 0.0f: Custom width
  • size.x < 0.0f or -FLT_MIN: Right-align
  • size.x = 0.0f: Use current ItemWidth
  • size.y > 0.0f: Custom height
  • size.y < 0.0f or -FLT_MIN: Bottom-align
  • size.y = 0.0f: Default height (~7 items)

Custom Sized List Box

Simple ListBox() Function

Convenience wrapper:

Highlighting Hovered Items

Multi-Column Lists

Combine list boxes with tables:

Complete Example

Performance Tips

For large lists, use ImGuiListClipper to only render visible items:

Best Practices

Use BeginCombo() / EndCombo() for full control over combo contents, including filtering and custom rendering.
Always call EndCombo() or EndListBox() only if the corresponding Begin function returned true.
Call SetItemDefaultFocus() on the selected item to ensure proper keyboard navigation when the popup opens.