Skip to main content

Overview

Dear ImGui provides comprehensive styling capabilities to customize the visual appearance of your UI. You can modify colors, spacing, rounding, and many other visual properties either globally or temporarily for specific UI elements.

Style Structure

The ImGuiStyle structure contains all styling properties. Access it via:

Key Style Properties

  • FontSizeBase - Current base font size before external global factors are applied
  • FontScaleMain - Main global scale factor
  • FontScaleDpi - Additional global scale factor from viewport/monitor contents scale
  • Alpha - Global alpha applies to everything in Dear ImGui
  • DisabledAlpha - Additional alpha multiplier applied by BeginDisabled()
  • WindowPadding - Padding within a window
  • WindowRounding - Radius of window corners rounding
  • WindowBorderSize - Thickness of border around windows (generally 0.0f or 1.0f)
  • WindowMinSize - Minimum window size
  • WindowTitleAlign - Alignment for title bar text
  • FramePadding - Padding within a framed rectangle (used by most widgets)
  • FrameRounding - Radius of frame corners rounding
  • FrameBorderSize - Thickness of border around frames
  • ItemSpacing - Horizontal and vertical spacing between widgets/lines
  • ItemInnerSpacing - Spacing within elements of a composed widget
  • IndentSpacing - Horizontal indentation when entering a tree node
  • CellPadding - Padding within a table cell
  • ScrollbarSize - Width of vertical scrollbar, height of horizontal scrollbar
  • ScrollbarRounding - Radius of grab corners for scrollbar
  • ScrollbarPadding - Padding of scrollbar grab within its frame
  • TabRounding - Radius of upper corners of a tab
  • TabBorderSize - Thickness of border around tabs
  • TabBarBorderSize - Thickness of tab-bar separator
  • TabBarOverlineSize - Thickness of tab-bar overline

Color Scheme

Dear ImGui uses an enum ImGuiCol_ to identify 58 different color elements:

Text Colors

Window Colors

Frame Colors

Title Bar Colors

Button Colors

Widget Colors

Tab Colors

Table Colors

Modifying Colors

Direct Modification

Temporary Color Changes

Use PushStyleColor() and PopStyleColor() to temporarily change colors:
Always match your PushStyleColor() calls with PopStyleColor()! Mismatched push/pop will cause visual glitches.

Using ImU32 Colors

Modifying Style Variables

Use PushStyleVar() and PopStyleVar() for temporary style changes:

Common Style Variables

Built-in Themes

Dear ImGui provides three built-in color themes:

Dark Theme (Default)

A dark theme suitable for most applications. This is the recommended default style.

Light Theme

A light theme best used with borders and a custom, thicker font.

Classic Theme

The classic ImGui style from earlier versions.

Style Editor

Dear ImGui includes a built-in style editor for live customization:
You can also compare against a reference style:

Complete Styling Example

Tips and Best Practices

  • Always use PushStyleColor()/PushStyleVar() to modify styles mid-frame
  • Direct modification of ImGuiStyle should be done at initialization or between frames
  • Use the built-in style editor during development to experiment with values
  • Keep track of push/pop pairs to avoid style stack errors

See Also