ktsu.ImGuiCredentialPopups
1.2.23
Prefix Reserved
See the version list below for details.
dotnet add package ktsu.ImGuiCredentialPopups --version 1.2.23
NuGet\Install-Package ktsu.ImGuiCredentialPopups -Version 1.2.23
<PackageReference Include="ktsu.ImGuiCredentialPopups" Version="1.2.23" />
<PackageVersion Include="ktsu.ImGuiCredentialPopups" Version="1.2.23" />
<PackageReference Include="ktsu.ImGuiCredentialPopups" />
paket add ktsu.ImGuiCredentialPopups --version 1.2.23
#r "nuget: ktsu.ImGuiCredentialPopups, 1.2.23"
#:package ktsu.ImGuiCredentialPopups@1.2.23
#addin nuget:?package=ktsu.ImGuiCredentialPopups&version=1.2.23
#tool nuget:?package=ktsu.ImGuiCredentialPopups&version=1.2.23
ktsu.ImGuiCredentialPopups
Ready-made Dear ImGui modal dialogs for collecting credentials.
Introduction
ktsu.ImGuiCredentialPopups provides drop-in modal dialogs for asking a user for credentials
inside a Dear ImGui application. Rather than hand-rolling an input modal, masked text field, and
confirm/cancel button pair for every application that needs to authenticate, you open a popup and
receive a Credential back through a callback.
The credential types come from ktsu.CredentialCache,
so what the popup hands you is ready to persist in the host's native keyring or pass straight to an
API client.
Features
- Username/Password Popup:
UsernamePasswordPopupcollects a username and a masked password and returns aCredentialWithUsernamePassword. - Token Popup:
TokenPopupcollects a single masked token value and returns aCredentialWithToken. - Shared Base Class:
CredentialPopuphandles the modal lifecycle, title and label configuration, and confirmation callback, so adding a new credential shape means overriding two methods. - Masked Input: Secret fields use
ImGuiInputTextFlags.Passwordso values are never rendered in plain text. - Automatic Focus: The first input field receives keyboard focus when the modal opens, so the user can start typing immediately.
- CredentialCache Integration: Results are
ktsu.CredentialCachecredential types, ready to store through anICredentialStore.
Installation
Package Manager Console
Install-Package ktsu.ImGuiCredentialPopups
.NET CLI
dotnet add package ktsu.ImGuiCredentialPopups
Package Reference
<PackageReference Include="ktsu.ImGuiCredentialPopups" Version="x.y.z" />
Usage Examples
Basic Example
Create the popup once and keep it alive for the lifetime of the window, then call ShowIfOpen()
every frame from your render loop.
using ktsu.CredentialCache;
using ktsu.ImGuiCredentialPopups;
private readonly UsernamePasswordPopup loginPopup = new();
private void OnRender()
{
if (ImGui.Button("Sign in"))
{
loginPopup.Open("Sign in to GitHub", "Credentials", credential =>
{
CredentialWithUsernamePassword login = (CredentialWithUsernamePassword)credential;
Authenticate(login.Username, login.Password);
});
}
// Must be called every frame so the modal can draw itself.
loginPopup.ShowIfOpen();
}
Collecting a Token
using ktsu.CredentialCache;
using ktsu.ImGuiCredentialPopups;
private readonly TokenPopup tokenPopup = new();
private void OnRender()
{
if (ImGui.Button("Set access token"))
{
tokenPopup.Open("Personal Access Token", "Token", credential =>
{
CredentialWithToken token = (CredentialWithToken)credential;
cache.Store("github", token);
});
}
tokenPopup.ShowIfOpen();
}
Adding a Custom Credential Popup
Derive from CredentialPopup and supply the input UI and the credential it produces.
using ktsu.ImGuiCredentialPopups;
public class ApiKeyPopup : CredentialPopup
{
private string apiKey = string.Empty;
protected override bool ShowEdit()
{
ImGui.InputText("API Key", ref apiKey, 200, ImGuiInputTextFlags.Password);
return false;
}
protected override Credential MakeCredential() =>
new CredentialWithToken { Token = apiKey.As<CredentialToken>() };
}
API Reference
CredentialPopup
Abstract base class for credential input popups.
Properties
| Name | Type | Description |
|---|---|---|
Title |
string |
Title of the popup window. |
Label |
string |
Label shown above the input fields. |
Modal |
ImGuiPopups.Modal |
The underlying modal used to render the dialog. |
Methods
| Name | Return Type | Description |
|---|---|---|
Open(string title, string label, Action<Credential> onConfirm) |
void |
Opens the popup and registers the callback invoked on confirmation. |
ShowIfOpen() |
bool |
Renders the popup if it is open and returns whether it is open. Call once per frame. |
ShowEdit() |
bool |
(protected, abstract) Draws the input fields. Returns true if the user completed input via a keyboard shortcut. |
MakeCredential() |
Credential |
(protected, abstract) Builds the credential from the current input values. |
UsernamePasswordPopup
CredentialPopup that collects a username and masked password, producing a
CredentialWithUsernamePassword.
TokenPopup
CredentialPopup that collects a single masked token, producing a CredentialWithToken.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
This project is licensed under the MIT License. See the LICENSE.md file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Hexa.NET.ImGui (>= 2.2.9)
- ktsu.CaseConverter (>= 1.8.2)
- ktsu.CredentialCache (>= 1.3.58)
- ktsu.ImGui.Popups (>= 3.50.0)
- ktsu.Semantics.Strings (>= 5.8.3)
-
net9.0
- Hexa.NET.ImGui (>= 2.2.9)
- ktsu.CaseConverter (>= 1.8.2)
- ktsu.CredentialCache (>= 1.3.58)
- ktsu.ImGui.Popups (>= 3.50.0)
- ktsu.Semantics.Strings (>= 5.8.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.24-pre.1 | 0 | 9/30/2026 |
| 1.2.23 | 70 | 9/29/2026 |
| 1.2.23-pre.1 | 42 | 9/28/2026 |
| 1.2.22 | 96 | 9/25/2026 |
| 1.2.21 | 90 | 9/24/2026 |
| 1.2.20 | 100 | 9/23/2026 |
| 1.2.19 | 92 | 9/22/2026 |
| 1.2.18 | 100 | 9/21/2026 |
| 1.2.17 | 121 | 9/18/2026 |
| 1.2.16 | 103 | 9/17/2026 |
| 1.2.15 | 102 | 9/16/2026 |
| 1.2.14 | 116 | 9/15/2026 |
| 1.2.13 | 118 | 9/14/2026 |
| 1.2.12 | 105 | 9/14/2026 |
| 1.2.11 | 108 | 9/11/2026 |
| 1.2.10 | 109 | 9/10/2026 |
| 1.2.9 | 113 | 9/9/2026 |
| 1.2.8 | 115 | 9/8/2026 |
| 1.2.7 | 110 | 9/7/2026 |
| 1.2.6 | 111 | 9/4/2026 |
## v1.2.23 (patch)
Changes since v1.2.22:
- Move CI onto the shared ci-shared.yml pipeline ([@Claude](https://github.com/Claude))