ktsu.TUI.Core 1.0.48

Prefix Reserved
dotnet add package ktsu.TUI.Core --version 1.0.48
                    
NuGet\Install-Package ktsu.TUI.Core -Version 1.0.48
                    
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.TUI.Core" Version="1.0.48" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ktsu.TUI.Core" Version="1.0.48" />
                    
Directory.Packages.props
<PackageReference Include="ktsu.TUI.Core" />
                    
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.TUI.Core --version 1.0.48
                    
#r "nuget: ktsu.TUI.Core, 1.0.48"
                    
#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.TUI.Core@1.0.48
                    
#: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.TUI.Core&version=1.0.48
                    
Install as a Cake Addin
#tool nuget:?package=ktsu.TUI.Core&version=1.0.48
                    
Install as a Cake Tool

ktsu.TUI

A modern, extensible Text User Interface (TUI) library for .NET applications built on top of Spectre.Console. This library provides a clean, object-oriented approach to building interactive terminal applications with rich visual features.

License NuGet Version NuGet Version NuGet Downloads GitHub commit activity GitHub contributors GitHub Actions Workflow Status

Overview

ktsu.TUI is designed with SOLID principles and provides a modular architecture for creating terminal-based user interfaces. It features:

  • Modular Architecture: Clean separation of concerns with contracts, models, services, and UI elements
  • Event-Driven Rendering: Efficient rendering system that only updates when needed
  • Extensible Design: Easy to extend with custom UI elements and layouts
  • Provider Abstraction: Pluggable console providers (currently supports Spectre.Console)
  • Dependency Injection Ready: Built with DI in mind for easy integration

Features

Rich Text Styling: Bold, italic, underline, colors, and background colors
Border Elements: Multiple border styles (single, double, rounded, thick, ASCII, none)
Layout System: Stack panels with horizontal/vertical orientation and spacing
Input Handling: Keyboard input processing with ESC to exit
Alignment Support: Horizontal and vertical text alignment
Padding & Positioning: Flexible positioning and padding system
Responsive Design: Automatic sizing based on content and container dimensions

Architecture

Contracts → Models → Services
    ↓         ↓         ↓
Elements → Layouts → Primitives
    ↓
Provider Abstraction
  • Contracts: Interfaces defining the core abstractions
  • Models: Data structures for styling, positioning, and input
  • Services: Core application logic and console providers
  • Elements: UI components (primitives like borders/text, layouts like stack panels)
  • Extensions: Helper methods and utilities

Installation

Add the NuGet package:

dotnet add package ktsu.TUI

Quick Start

using ktsu.TUI.Core.Services;
using ktsu.TUI.Core.Elements.Primitives;
using ktsu.TUI.Core.Elements.Layouts;
using ktsu.TUI.Core.Models;

// Create console provider
var consoleProvider = new SpectreConsoleProvider();

// Create a simple UI
var ui = new BorderElement
{
    Title = "My TUI App",
    BorderStyle = BorderStyle.Double,
    Child = new TextElement
    {
        Text = "Hello, TUI World!",
        Style = new TextStyle { IsBold = true, Foreground = "green" }
    }
};

// Create and run application
var app = UIApplication.CreateBuilder(consoleProvider)
    .UseRootElement(ui)
    .Build();

await app.RunAsync();

Demo Applications

The library includes several demonstration applications:

  • Sample App (default): Advanced demo showcasing architecture and features
  • Interactive Demo: Interactive controls and real-time updates (--interactive)
  • Showcase Demo: Visual demonstration of all styling features (--showcase)

Run demos:

dotnet run --project TUI.App                    # Sample app
dotnet run --project TUI.App -- --interactive   # Interactive demo
dotnet run --project TUI.App -- --showcase      # Showcase demo

Key Components

UI Elements

  • TextElement: Styled text display
  • BorderElement: Bordered containers with titles
  • StackPanel: Horizontal/vertical layout container

Styling

  • TextStyle: Font styling (bold, italic, underline, colors)
  • BorderStyle: Border appearance (single, double, rounded, etc.)
  • Padding: Space around content
  • Position: Element positioning

Input System

  • Keyboard input handling
  • ESC key to exit applications
  • Extensible input event system

Contributing

This project follows clean architecture principles and emphasizes:

  • SOLID design principles
  • DRY (Don't Repeat Yourself) implementation
  • Comprehensive testing
  • Clear separation of concerns

License

MIT License. Copyright (c) ktsu.dev

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

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.0.48 41 8/21/2026
1.0.47 97 8/20/2026
1.0.46 142 8/19/2026
1.0.45 117 8/19/2026
1.0.44 88 8/17/2026
1.0.43 87 8/11/2026
1.0.42 89 8/11/2026
1.0.41 141 7/3/2026
1.0.40 109 7/1/2026
1.0.39 117 6/30/2026
1.0.38 114 6/29/2026
1.0.37 104 6/28/2026
1.0.36 106 6/28/2026
1.0.35 120 6/12/2026
1.0.34 120 6/12/2026
1.0.33 128 6/9/2026
1.0.32 125 6/8/2026
1.0.31 119 6/3/2026
1.0.30 117 5/22/2026
1.0.29 114 5/19/2026
Loading failed

## v1.0.48 (patch)

Changes since v1.0.47:

- Bump the ktsu group with 9 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))