Razor-sharp Terminal UIs for .NET 10
A cell-based rendering engine with ANSI escape sequence support, styled text, a rope-backed edit buffer with full undo/redo, Razor component hosting, and a plugin architecture.
$ dotnet add package TermBlade.Core
info : Adding PackageReference for 'TermBlade.Core'...
info : Package 'TermBlade.Core' installed successfully.
Start where you are
Choose a guided tutorial, a task-focused recipe, or a runnable repository example. The component gallery remains the complete visual reference.
Create a Razor terminal application, add layout, state, input, and run it.
Follow the tutorial →Pick a focused guide for tables, editors, dashboards, tools, and terminal lifecycle.
Open the guides →Use the existing Core, Razor, gallery, chess, CSV viewer, and file manager examples.
Browse examples →2D terminal cell grid with text, borders, blitting, and alpha blending. Full ANSI escape sequence support with true-color and 256-color palettes.
High-performance text editing with a rope data structure. Full cursor navigation, insert/delete operations, and unlimited undo/redo.
Only redraws cells that have changed between frames. Alternate screen support for clean terminal management.
Extensible plugin system with registration and lifecycle management. Build and share custom components.
Use familiar Razor syntax to build terminal UIs. Component-based architecture with data binding and event handling.
Built-in components: Box, Text, Input, Select, TreeView, Slider, ScrollBox, Markdown, Code highlighting, Diff viewer, and more.
TermBlade offers two approaches to build terminal UIs. Use TermBlade.Core for low-level, imperative drawing with full control over cells, colors, and ANSI sequences. Use TermBlade.Razor for a declarative, component-based experience with familiar Razor syntax.
dotnet add package TermBlade.Core
using TermBlade.Core.Ansi;
using TermBlade.Core.Buffer;
using var buf = CellBuffer.Create(60, 20);
var bg = Rgba.FromInts(0, 0, 0);
var fg = Rgba.FromInts(255, 255, 255);
var accent = Rgba.FromInts(0, 200, 255);
buf.Clear(bg);
buf.DrawBox(0, 0, 60, 20, accent, bg, BorderStyle.Rounded, BorderSides.All,
fill: true, title: " My App ");
buf.DrawText("Hello from TermBlade!", 4, 3, fg, bg);
dotnet build
dotnet run
dotnet add package TermBlade.Razor
MyApp.razor)<Box Width="100%" Height="100%" Border="true" BorderStyle="rounded" BorderColor="#00c8ff" BackgroundColor="#000000" Title=" My App ">
<Text Content="Hello from TermBlade!" Fg="#ffffff" />
</Box>
Program.cs)using Microsoft.Extensions.Hosting;
using TermBlade.Razor.Hosting;
var host = Host.CreateDefaultBuilder(args)
.UseTermBladeRazor<MyApp>()
.Build();
await host.RunAsync();
dotnet run
| Type | Description |
|---|---|
Rgba | Packed color: RGB, ANSI-256 indexed, or terminal-default intent |
CellBuffer | 2D terminal cell grid with text, borders, blitting, alpha blend |
TextBuffer | Styled text storage (read-only display) |
EditBuffer | Rope-backed editor: cursor, insert/delete, undo/redo |
Renderer | Diff-based ANSI terminal renderer with alternate-screen support |
SyntaxStyle | Named style definitions with priority-aware merging |
EventEmitter | Simple on/off/once/emit event bus |
PluginRegistry | IPlugin registration and lifecycle |
src/TermBlade.Core/ # Core library (NuGet package)
Ansi/ # Rgba, AnsiCodes, TextAttributes, ColorIntent
Buffer/ # CellBuffer, Cell, BorderStyle
Text/ # TextBuffer, EditBuffer, Rope, StyledText
Rendering/ # Renderer (diff-based, alternate screen)
Syntax/ # SyntaxStyle, StyleDefinition
Events/ # EventEmitter
Plugins/ # IPlugin, PluginRegistry
src/TermBlade.Razor/ # Razor host + component wrappers
src/TermBlade.FileManager/ # Global dotnet tool: file manager
src/TermBlade.CsvViewer/ # Global dotnet tool: CSV viewer
tests/TermBlade.Tests/ # xUnit test suite
samples/TermBlade.Samples/ # Sample console applications
samples/TermBlade.Razor.Samples/ # Razor-hosted sample applications
samples/TermBlade.Gallery/ # Interactive component gallery
$ dotnet run --project samples/TermBlade.Samples -- layout # simple box layout
$ dotnet run --project samples/TermBlade.Samples -- styled # text attributes
$ dotnet run --project samples/TermBlade.Samples -- editor # edit buffer demo
$ dotnet run --project samples/TermBlade.Samples -- scroll # scrolling content
$ dotnet run --project samples/TermBlade.Samples -- input # keyboard input
$ dotnet run --project samples/TermBlade.Samples -- treeview # tree view demo
$ dotnet run --project samples/TermBlade.Razor.Samples -- treeview # razor tree view demo
$ dotnet run --project samples/TermBlade.Razor.Samples -- chess # chess game (Razor)
$ dotnet run --project src/TermBlade.Chess # chess standalone app
$ dotnet run --project samples/TermBlade.Gallery # interactive component gallery
$ dotnet tool install --global TermBlade.FileManager
$ tbfm ./src
$ dotnet tool install --global TermBlade.CsvViewer
$ tbcsv ./data.csv # Razor-hosted, less-like CSV table viewer
TermBlade.Razor.
Features a cell-based board renderer, move history panel, material tracking, bot opponent toggle,
inline help overlay, and mouse support — all in the terminal.
$ dotnet run --project src/TermBlade.Chess