NeoKolors.Tui.Widgets 2026.4.0-preview.4

This is a prerelease version of NeoKolors.Tui.Widgets.
dotnet add package NeoKolors.Tui.Widgets --version 2026.4.0-preview.4
                    
NuGet\Install-Package NeoKolors.Tui.Widgets -Version 2026.4.0-preview.4
                    
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="NeoKolors.Tui.Widgets" Version="2026.4.0-preview.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NeoKolors.Tui.Widgets" Version="2026.4.0-preview.4" />
                    
Directory.Packages.props
<PackageReference Include="NeoKolors.Tui.Widgets" />
                    
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 NeoKolors.Tui.Widgets --version 2026.4.0-preview.4
                    
#r "nuget: NeoKolors.Tui.Widgets, 2026.4.0-preview.4"
                    
#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 NeoKolors.Tui.Widgets@2026.4.0-preview.4
                    
#: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=NeoKolors.Tui.Widgets&version=2026.4.0-preview.4&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=NeoKolors.Tui.Widgets&version=2026.4.0-preview.4&prerelease
                    
Install as a Cake Tool

NeoKolors.Tui.Widgets

Build & Test NuGet Version License

NeoKolors.Tui.Widgets is a companion package providing lightweight, standalone interactive widgets (such as progress bars, spinners, status monitors, and composite live UIs) directly inside standard console streams without needing to initialize a full-screen TUI application lifecycle or allocate an alternate screen buffer.


Key Features

  • Inline Execution Lifecycle (InlineLifecycleHost):
    • Non-blocking background rendering loop running concurrently alongside your async or synchronous workloads.
    • Automatically preserves terminal scrollback history and standard output flow.
    • Relative ANSI cursor rewind (\e[{N}A\r) and erase-to-end-of-line (\e[K), eliminating terminal flicker.
    • Option to persist final output (e.g. ✔ Finished in 1.4s) or cleanly erase the widget area upon task conclusion.
  • Composable Elements (IElement):
    • All widgets implement IElement, meaning they can be composed arbitrarily with standard NeoKolors elements (Flex, Grid, Border, Text, Table).
    • Use the exact same widget components in small CLI scripts or nested within full-screen AppLifecycleHost TUI views.
  • Reactive Updates (Signal<T>):
    • Update values directly (progress.Value = 0.85), automatically reflected in the next render frame or via explicit ctx.Invalidate().
  • Rich Presets & Smooth Block Rendering:
    • Built-in spinner styles: Dots, Line, Circle, Pulse, BouncingBar, Arc, Braille, Ascii, Clock, Arrow.
    • Progress bar sub-cell smooth filling using unicode fractional block characters ( , ▏, ▎, ▍, ▌, ▋, ▊, ▉, █).

Quickstart Examples

1. Simple Status Spinner

using NeoKolors.Tui.Widgets.Live;

await NKWidgets.StatusAsync("Fetching dependencies...", async ctx => {
    await Task.Delay(1000);
    ctx.Status = "Compiling bytecode...";
    await Task.Delay(1500);
    ctx.Success("Build succeeded in 2.5s!");
});

2. Progress Bar

using NeoKolors.Tui.Widgets.Live;

await NKWidgets.ProgressAsync("Downloading runtime assets...", async ctx => {
    for (int i = 0; i <= 100; i += 5) {
        ctx.Report(i / 100.0, $"Downloading chunk {i}/100...");
        await Task.Delay(50);
    }
});

3. Composite UI with Normal Elements

Render any declarative element tree inline in the console stream:

using NeoKolors.Common;
using NeoKolors.Tui.Core;
using NeoKolors.Tui.Elements;
using NeoKolors.Tui.Widgets.Elements;
using NeoKolors.Tui.Widgets.Live;

var progress = new Signal<double>(0.0);
var status = new Signal<string>("Starting engine...");

var root = new Border(
    element: new Flex(
        direction: FlexDirection.COLUMN,
        children: new IElement[] {
            new Flex(
                direction: FlexDirection.ROW,
                gap: 1,
                children: new IElement[] {
                    new SpinnerElement(SpinnerStyle.Dots),
                    new Text((Func<AnsiString>)(() => new AnsiString(status.Value)))
                }
            ),
            new ProgressBarElement {
                Value = progress,
                UseSmoothBlocks = true,
                Width = 40
            }
        }
    ),
    style: NKBorderStyle.GetRounded()
);

await NKWidgets.LiveAsync(root, async ctx => {
    for (int i = 0; i <= 100; i += 2) {
        progress.Value = i / 100.0;
        status.Value = $"Processing batch {i}%...";
        await Task.Delay(40);
    }
});

Architecture Overview

flowchart TD
    subgraph Widgets ["NeoKolors.Tui.Widgets"]
        Spinner["SpinnerElement<br/>(ITickableElement, IElement)"]
        Progress["ProgressBarElement<br/>(IElement)"]
        Status["StatusElement<br/>(IElement)"]
        Composite["Normal Elements<br/>(Flex, Grid, Border, Text)"]
    end

    subgraph Host ["Inline Lifecycle"]
        ILH["InlineLifecycleHost<br/>(LifecycleController)"]
        Screen["NKInlineScreen<br/>(Relative Cursor Presenter)"]
    end

    Widgets --> ILH
    ILH --> Screen
    Screen --> ConsoleOut["Standard Terminal Stream<br/>(Preserves scrollback)"]
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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 56 11/15/2026
2026.4.0-preview.3 67 11/1/2026
2026.4.0-preview.2 60 10/30/2026
2026.4.0-preview.1 69 10/23/2026