ktsu.ImGui.Popups 3.37.0

Prefix Reserved
dotnet add package ktsu.ImGui.Popups --version 3.37.0
                    
NuGet\Install-Package ktsu.ImGui.Popups -Version 3.37.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ktsu.ImGui.Popups" Version="3.37.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ktsu.ImGui.Popups" Version="3.37.0" />
                    
Directory.Packages.props
<PackageReference Include="ktsu.ImGui.Popups" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ktsu.ImGui.Popups --version 3.37.0
                    
#r "nuget: ktsu.ImGui.Popups, 3.37.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ktsu.ImGui.Popups@3.37.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ktsu.ImGui.Popups&version=3.37.0
                    
Install as a Cake Addin
#tool nuget:?package=ktsu.ImGui.Popups&version=3.37.0
                    
Install as a Cake Tool

ktsu.ImGui.Popups

NuGet License

A comprehensive library for custom popup windows and modal dialogs for Dear ImGui, built on the Hexa.NET.ImGui bindings, providing a rich set of UI components for interactive applications.

Features

🪟 Modal Windows

  • Modal: Base modal window with customizable content and size
  • MessageOK: Simple message dialog with OK button
  • Prompt: Customizable prompt with multiple button options

📝 Input Components

  • InputString: Text input popup with validation
  • InputInt: Integer input popup with numeric validation
  • InputFloat: Floating-point input popup with numeric validation

🔍 Selection Components

  • SearchableList: Searchable dropdown list with filtering capabilities
  • FilesystemBrowser: Advanced file/directory browser with:
    • Open and Save modes
    • File and Directory targeting
    • Pattern filtering support
    • Navigation breadcrumbs

✨ Key Features

  • Responsive Design: All popups adapt to content and custom sizing
  • Keyboard Navigation: Full keyboard support with proper focus management
  • Validation: Built-in input validation and error handling
  • Customizable: Flexible styling and layout options
  • Type-Safe: Generic components with strong typing

Installation

Package Manager Console

Install-Package ktsu.ImGui.Popups

.NET CLI

dotnet add package ktsu.ImGui.Popups

PackageReference

<PackageReference Include="ktsu.ImGui.Popups" Version="x.y.z" />

Quick Start

using ktsu.ImGui.Popups;

// Create popup instances (typically as class members)
private static readonly ImGuiPopups.MessageOK messageOK = new();
private static readonly ImGuiPopups.InputString inputString = new();
private static readonly ImGuiPopups.SearchableList<string> searchableList = new();

// In your ImGui render loop
private void OnRender()
{
    // Show a simple message
    if (ImGui.Button("Show Message"))
    {
        messageOK.Open("Information", "Hello, World!");
    }
    
    // Get text input from user
    if (ImGui.Button("Get Input"))
    {
        inputString.Open("Enter Name", "Name:", "Default Name", 
            result => Console.WriteLine($"User entered: {result}"));
    }
    
    // Show searchable selection
    if (ImGui.Button("Select Item"))
    {
        var items = new[] { "Apple", "Banana", "Cherry", "Date" };
        searchableList.Open("Select Fruit", "Choose:", items, null, 
            item => item, // Text converter
            selected => Console.WriteLine($"Selected: {selected}"),
            Vector2.Zero);
    }
    
    // Render all popups (call this once per frame)
    messageOK.ShowIfOpen();
    inputString.ShowIfOpen();
    searchableList.ShowIfOpen();
}

Component Documentation

MessageOK

Simple message dialog with an OK button.

var messageOK = new ImGuiPopups.MessageOK();
messageOK.Open("Title", "Your message here");

Input Components

Get validated input from users:

// String input
var inputString = new ImGuiPopups.InputString();
inputString.Open("Enter Text", "Label:", "default", result => HandleString(result));

// Integer input
var inputInt = new ImGuiPopups.InputInt();
inputInt.Open("Enter Number", "Value:", 42, result => HandleInt(result));

// Float input
var inputFloat = new ImGuiPopups.InputFloat();
inputFloat.Open("Enter Float", "Value:", 3.14f, result => HandleFloat(result));

SearchableList

Searchable selection from a list of items:

var searchableList = new ImGuiPopups.SearchableList<MyClass>();
searchableList.Open(
    title: "Select Item",
    label: "Choose an item:",
    items: myItemList,
    defaultItem: null,
    getText: item => item.DisplayName, // How to display items
    onConfirm: selected => HandleSelection(selected),
    customSize: new Vector2(400, 300)
);

FilesystemBrowser

Advanced file and directory browser:

var browser = new ImGuiPopups.FilesystemBrowser();

// Open a file (the optional glob filters which files are shown)
browser.FileOpen("Open File", path => OpenFile(path), glob: "*.txt");

// Save a file
browser.FileSave("Save File", path => SaveFile(path), glob: "*.txt");

// Choose a directory
browser.ChooseDirectory("Select Folder", dir => UseDirectory(dir));

// Render the browser each frame in your ImGui loop
browser.ShowIfOpen();

File callbacks receive an AbsoluteFilePath and directory callbacks an AbsoluteDirectoryPath (from ktsu.Semantics.Paths). Each FileOpen/FileSave/ChooseDirectory overload also accepts a Vector2 customSize.

Custom Modal

Create custom modal dialogs:

var customModal = new ImGuiPopups.Modal();
customModal.Open("Custom Dialog", () => {
    ImGui.Text("Custom content here");
    if (ImGui.Button("Close"))
    {
        ImGui.CloseCurrentPopup();
    }
}, new Vector2(300, 200));

Advanced Usage

Custom Sizing

All popups support custom sizing:

// Fixed size
popup.Open("Title", "Content", new Vector2(400, 300));

// Auto-size (Vector2.Zero)
popup.Open("Title", "Content", Vector2.Zero);

Text Layout Options

Prompts support different text layout modes:

var prompt = new ImGuiPopups.Prompt();
prompt.Open("Title", "Long message text here...", 
    buttons: new() { { "OK", null }, { "Cancel", null } },
    textLayoutType: PromptTextLayoutType.Wrapped, // or Unformatted
    size: new Vector2(400, 200)
);

Validation and Error Handling

Input components provide built-in validation:

inputInt.Open("Enter Age", "Age (1-120):", 25, result => {
    if (result < 1 || result > 120)
    {
        messageOK.Open("Error", "Age must be between 1 and 120");
        return;
    }
    ProcessAge(result);
});

Demo Application

The repository includes a comprehensive demo application showcasing all components:

git clone https://github.com/ktsu-dev/ImGuiApp.git
cd ImGuiApp
dotnet run --project examples/ImGuiPopupsDemo

Dependencies

Changelog

See CHANGELOG.md for a detailed history of changes.


ktsu.dev - Building tools for developers

Acknowledgments

Contributing

Contributions are welcome! For feature requests, bug reports, or questions, please open an issue on the GitHub repository. If you would like to contribute code, please open a pull request with your changes.

License

ImGui.Popups is licensed under the MIT License. See LICENSE.md for more information.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ktsu.ImGui.Popups:

Package Downloads
ktsu.ImGui.Styler

A powerful styling library for ImGui.NET interfaces featuring 50+ built-in themes (Catppuccin, Tokyo Night, Gruvbox, Dracula, Nord, and more), interactive theme browser, scoped styling system for colors and style variables, advanced color manipulation with hex support and accessibility features, automatic content alignment and centering, semantic text colors, button alignment, and indentation utilities.

ktsu.ImGuiCredentialPopups

A .NET library providing ready-made Dear ImGui modal dialogs for collecting credentials. Ships username/password and token popups built on a shared CredentialPopup base, with masked input, automatic keyboard focus, and confirmation callbacks that hand back a ktsu.CredentialCache credential ready to store or use.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.37.0 0 2026/9/14
3.36.0 0 2026/9/14
3.35.0 0 2026/9/13
3.34.0 39 2026/9/13
3.33.1 66 2026/9/13
3.33.0 99 2026/9/12
3.32.3 62 2026/9/11
3.32.2 292 2026/9/10
3.32.1 205 2026/9/9
3.32.0 321 2026/9/9
3.31.0 170 2026/9/9
3.30.0 122 2026/9/9
3.29.0 149 2026/9/9
3.28.0 136 2026/9/9
3.27.0 131 2026/9/9
3.26.1 168 2026/9/8
3.26.0 138 2026/9/8
3.25.0 143 2026/9/8
3.24.0 145 2026/9/8
3.23.0 146 2026/9/8
Loading failed

## v3.37.0 (minor)

Changes since v3.36.0:

- Remove generic catch from SetWindowIcon test ([@copilot-swe-agent[bot]](https://github.com/copilot-swe-agent[bot]))
- Address Sonar gate coverage for macOS icon change ([@copilot-swe-agent[bot]](https://github.com/copilot-swe-agent[bot]))
- Fix macOS app icon handling ([@copilot-swe-agent[bot]](https://github.com/copilot-swe-agent[bot]))
- Initial plan ([@copilot-swe-agent[bot]](https://github.com/copilot-swe-agent[bot]))