Skip to main content
Text widgets display information to the user without requiring interaction. Dear ImGui provides several text functions for different formatting needs.

Basic Text Functions

Text()

Display formatted text using printf-style formatting:

TextUnformatted()

Display raw text without formatting (faster for long text):
TextUnformatted() is more efficient than Text() for long text blocks as it doesn’t process format specifiers. It also supports non-null-terminated strings when text_end is provided.

Colored Text

TextColored()

Display text with a custom color:

TextDisabled()

Display text with the disabled color from the current style:
The disabled color is defined in ImGuiStyle::Colors[ImGuiCol_TextDisabled]. Use this for consistency across your application.

Wrapped Text

TextWrapped()

Display text that automatically wraps at the window edge:

Custom Text Wrapping

For more control over text wrapping, use PushTextWrapPos() / PopTextWrapPos():
float
  • < 0.0f: No wrapping
  • = 0.0f: Wrap to end of window (or column)
  • > 0.0f: Wrap at specified position in window local space

Label and Value Pairs

LabelText()

Display a label and value aligned like other widgets:

BulletText()

Display text with a bullet point:
You can also use Bullet() separately to just draw the bullet:

Separator Text

SeparatorText()

Display a horizontal line with text (added in recent versions):
Display clickable hyperlink-style text:

Font Size Control

You can change the font size for text rendering:
Use NULL for the font parameter to keep the current font. The font_size_base_unscaled parameter is the size before global scale factors are applied.

Complete Example

Best Practices

Avoid calling Text() in tight loops with string concatenation. Pre-format strings or use TextUnformatted() for better performance.
Use ImGui::GetIO().Framerate to display FPS: ImGui::Text("%.1f FPS", ImGui::GetIO().Framerate);