Skip to main content

Tab Bars

Tabs are automatically created by the docking system (when in ‘docking’ branch). Use this to create tab bars/tabs yourself.

BeginTabBar

Create and append into a TabBar. Only call EndTabBar() if this returns true.
const char*
Unique identifier for the tab bar
ImGuiTabBarFlags
default:"0"
Tab bar flags (see ImGuiTabBarFlags_)
bool
True if tab bar is visible

EndTabBar

Close tab bar. Only call EndTabBar() if BeginTabBar() returns true.

Tab Items

BeginTabItem

Create a Tab. Returns true if the Tab is selected.
const char*
Tab label
bool*
default:"NULL"
Optional pointer to bool to enable close button (set to false when clicked)
ImGuiTabItemFlags
default:"0"
Tab item flags (see ImGuiTabItemFlags_)
bool
True when tab is selected

EndTabItem

Close tab item. Only call EndTabItem() if BeginTabItem() returns true.

TabItemButton

Create a Tab behaving like a button. Return true when clicked. Cannot be selected in the tab bar.
const char*
Button label
ImGuiTabItemFlags
default:"0"
Tab item flags
bool
True when clicked

SetTabItemClosed

Notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.
const char*
Tab or window label

Tab Bar Flags

ImGuiTabBarFlags_

Flags for BeginTabBar().

Tab Item Flags

ImGuiTabItemFlags_

Flags for BeginTabItem().

Complete Example