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
<PackageReference Include="ktsu.TUI.Core" Version="1.0.48" />
<PackageVersion Include="ktsu.TUI.Core" Version="1.0.48" />
<PackageReference Include="ktsu.TUI.Core" />
paket add ktsu.TUI.Core --version 1.0.48
#r "nuget: ktsu.TUI.Core, 1.0.48"
#:package ktsu.TUI.Core@1.0.48
#addin nuget:?package=ktsu.TUI.Core&version=1.0.48
#tool nuget:?package=ktsu.TUI.Core&version=1.0.48
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.
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 displayBorderElement: Bordered containers with titlesStackPanel: Horizontal/vertical layout container
Styling
TextStyle: Font styling (bold, italic, underline, colors)BorderStyle: Border appearance (single, double, rounded, etc.)Padding: Space around contentPosition: 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 | 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 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Spectre.Console (>= 0.57.2)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Spectre.Console (>= 0.57.2)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- Spectre.Console (>= 0.57.2)
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 |
## v1.0.48 (patch)
Changes since v1.0.47:
- Bump the ktsu group with 9 updates ([@dependabot[bot]](https://github.com/dependabot[bot]))