NeoKolors.Tui
2026.4.0-preview.4
dotnet add package NeoKolors.Tui --version 2026.4.0-preview.4
NuGet\Install-Package NeoKolors.Tui -Version 2026.4.0-preview.4
<PackageReference Include="NeoKolors.Tui" Version="2026.4.0-preview.4" />
<PackageVersion Include="NeoKolors.Tui" Version="2026.4.0-preview.4" />
<PackageReference Include="NeoKolors.Tui" />
paket add NeoKolors.Tui --version 2026.4.0-preview.4
#r "nuget: NeoKolors.Tui, 2026.4.0-preview.4"
#:package NeoKolors.Tui@2026.4.0-preview.4
#addin nuget:?package=NeoKolors.Tui&version=2026.4.0-preview.4&prerelease
#tool nuget:?package=NeoKolors.Tui&version=2026.4.0-preview.4&prerelease
NeoKolors.Tui
NeoKolors.Tui is a state-driven, component-oriented Text User Interface (TUI) framework for .NET.
It provides double-buffered canvas rendering, flexible layout panels, responsive borders,
interactive mouse support, and modular application and game lifecycle engines.
Modular Architecture
The TUI ecosystem is divided into focused modules:
- NeoKolors.Tui.Core: Double-buffered
NKCharCanvasandNKCharScreen, diff-based ANSI flusher, custom border styling (NKBorderStyle), cell layering (ZLayers), profiler, and spatial hit-maps (HitMap). - NeoKolors.Tui.Elements: Component tree featuring
Flex,Grid,Table,Border,Button,List,Text, and mouse event routing (ElementsMouseDispatcher). - NeoKolors.Tui.Lifecycle.Core: Engine foundation with
ILifecycle,LifecycleController,FrameClock,FixedTimestepAccumulator,DeltaTime, andSceneStack. - NeoKolors.Tui.Lifecycle.Apps: Application hosting infrastructure with
AppLifecycleHost,NKAppView, activation state tracking, and throttled/lazy rendering loops. - NeoKolors.Tui.Lifecycle.Game2D: 2D arcade terminal game loop, 2D camera viewport, and multi-stage rendering pipelines.
- NeoKolors.Tui.Lifecycle.Game3D: 3D terminal graphics lifecycle abstractions and architecture plans.
- NeoKolors.Tui.Fonts: Dynamic typography engine supporting XML V3 definitions,
MessagePack binary
.nkfcompilation, Figlet fonts, and font assets. - NeoKolors.Tui.Widgets: Standalone console widget controls.
Core Features
- Zero-Flicker Diff Rendering:
NKCharScreenmaintains front and back character buffers. WhenRender()executes, only changed character cells, foreground/background colors, and style attributes are converted to ANSI sequences, drastically reducing terminal I/O latency and eliminating screen flicker. - Declarative Layout Trees:
Compose views using
Flex(row/column orientation, justify content, align items, flex wrapping, gap spacing) andGrid(multi-row and multi-column tabular arrangements with Auto and Star sizing). - Interactive Mouse Dispatching:
Components register visual interaction bounds into a spatial
HitMap. Mouse clicks, movements, and scroll events are translated into clean component-level callbacks viaElementsMouseDispatcher. - Decoupled Execution Lifecycles:
Use
ThrottledAppLoopStrategyto throttle active rendering (e.g. 60 FPS) and background rendering (e.g. 10 FPS) when OS terminal window focus is lost. Wake up the render loop immediately on state changes usingSignalWakeup().
Getting Started
Building an interactive TUI application:
using System.Text;
using Metriks;
using NeoKolors.Common;
using NeoKolors.Console;
using NeoKolors.Tui.Core;
using NeoKolors.Tui.Elements;
using NeoKolors.Tui.Lifecycle.Apps;
Console.OutputEncoding = Encoding.UTF8;
// 1. Setup screen, hit map, and lifecycle host
var screen = new NKCharScreen(NKConsole.WindowSize);
var hitMap = new HitMap();
var mouseDispatcher = new ElementsMouseDispatcher();
var host = new AppLifecycleHost();
var loopStrategy = new ThrottledAppLoopStrategy { ActiveFps = 60 };
int counter = 0;
// 2. Define the UI builder
IElement BuildUi() {
var container = new Flex {
Direction = FlexDirection.Column,
Justify = FlexJustify.Center,
Align = FlexAlign.Center,
Width = screen.Size.X,
Height = screen.Size.Y
};
var btn = new Button {
Text = $" Clicked {counter} Times ",
NormalStyle = new NKStyle(NKColor.FromRgb(255, 255, 255), NKColor.FromRgb(50, 70, 180), TextStyles.Bold),
HoverStyle = new NKStyle(NKColor.FromRgb(255, 255, 255), NKColor.FromRgb(70, 110, 230), TextStyles.Bold)
};
btn.OnClick += () => {
counter++;
view.RootElement = BuildUi();
view.Invalidate();
loopStrategy.SignalWakeup();
};
var box = new Border(btn) {
Title = " Counter Dashboard ",
Style = NKBorderStyle.GetRounded(NKColor.FromRgb(0, 220, 180))
};
container.Add(box);
return container;
}
// 3. Create view presenter
var view = new NKAppView(BuildUi(), screen, hitMap);
// Wire inputs
NKConsole.Mouse += m => {
mouseDispatcher.Dispatch(hitMap, m);
view.Invalidate();
loopStrategy.SignalWakeup();
};
NKConsole.Key += k => {
if (k.Down && (k.Key == KeyCode.ESCAPE || k.Char == 'q'))
host.RequestClose();
};
// 4. Run the application
try {
NKConsole.HideCursor();
NKConsole.EnableAltBuffer();
host.Start();
while (host.State != LifecycleState.STOPPED) {
loopStrategy.Tick(host, view);
}
} finally {
NKConsole.DisableAltBuffer();
NKConsole.ShowCursor();
}
Documentation
For full guides, architecture diagrams, and tutorials, visit the official documentation: 👉 https://krykomdev.github.io/NeoKolors/
| Product | Versions 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 was computed. 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. net11.0 is compatible. |
-
net10.0
- JetBrains.Annotations (>= 2026.2.0)
- Metriks (>= 2026.4.0)
- NeoKolors.Common (>= 2026.4.0-preview.4)
- NeoKolors.Console (>= 2026.4.0-preview.4)
- NeoKolors.Extensions (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Core (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Elements (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Fonts (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Fonts.Assets (>= 2026.4.0-preview.4)
- Portable.Xaml (>= 0.26.0)
-
net11.0
- JetBrains.Annotations (>= 2026.2.0)
- Metriks (>= 2026.4.0)
- NeoKolors.Common (>= 2026.4.0-preview.4)
- NeoKolors.Console (>= 2026.4.0-preview.4)
- NeoKolors.Extensions (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Core (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Elements (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Fonts (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Fonts.Assets (>= 2026.4.0-preview.4)
- Portable.Xaml (>= 0.26.0)
-
net8.0
- JetBrains.Annotations (>= 2026.2.0)
- Metriks (>= 2026.4.0)
- NeoKolors.Common (>= 2026.4.0-preview.4)
- NeoKolors.Console (>= 2026.4.0-preview.4)
- NeoKolors.Extensions (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Core (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Elements (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Fonts (>= 2026.4.0-preview.4)
- NeoKolors.Tui.Fonts.Assets (>= 2026.4.0-preview.4)
- Portable.Xaml (>= 0.26.0)
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 |
|---|---|---|
| 2026.4.0-preview.4 | 55 | 11/15/2026 |
| 2026.4.0-preview.3 | 66 | 11/1/2026 |
| 2026.4.0-preview.2 | 61 | 10/30/2026 |
| 2026.4.0-preview.1 | 71 | 10/23/2026 |
| 2026.2.0-rc2.1 | 87 | 6/8/2026 |
| 2026.2.0-rc2 | 93 | 6/5/2026 |
| 2026.2.0-rc1 | 87 | 6/2/2026 |
| 2026.1.0-alpha7 | 100 | 3/5/2026 |
| 2026.1.0-alpha6 | 92 | 2/28/2026 |
| 2026.1.0-alpha5 | 90 | 2/28/2026 |
| 2026.1.0-alpha4 | 93 | 2/27/2026 |
| 2026.1.0-alpha3 | 87 | 2/27/2026 |
| 2026.1.0-alpha2 | 93 | 2/26/2026 |
| 2026.1.0-alpha1 | 91 | 2/25/2026 |
| 0.25.21-alpha | 223 | 5/19/2025 |
| 0.25.19-alpha | 175 | 5/6/2025 |