RazorConsole for .NET Terminal UIs
Build agentic TUI applications with .NET Razor and Spectre.Console
At a glance
- What is it?
- RazorConsole is a .NET library for building interactive terminal interfaces with Razor components and Spectre.Console. It suits developers who want component-based terminal UIs, but it requires the Razor SDK and is designed around console interaction rather than browser or desktop UI frameworks.
- Who is it for?
- RazorConsole is a reasonable fit for.NET developers building interactive terminal applications with Razor components, especially when Spectre.Console output and a component-based UI model are already desired. It is less suitable for projects that need a documented, stable Native AOT release or a browser or desktop UI target.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 2 days ago.
- What is it written in?
- Mainly C#, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.
Editorial analysis
RazorConsole's .NET Terminal UI Model
RazorConsole addresses a specific gap between ordinary console code and component-oriented application UI. The README describes it as a way to build rich, interactive console applications using Razor syntax and Spectre.Console. That combination is useful for .NET developers who already work with Razor components but need the output to remain in a terminal. It can provide familiar constructs such as parameters, event handlers, data binding, and component lifecycle methods without requiring a browser-based interface.
The library is intended for terminal applications that need more than sequential lines of text. Its component catalog includes buttons, text inputs, selectors, scrolling areas, charts, tables, panels, markdown rendering, syntax highlighting, and modal windows. The README lists 25 or more built-in components across layout, input, display, and utility categories. This makes the library relevant to command-line tools that need prompts, selectable options, live updates, charts, or structured terminal output.
It is not a general-purpose UI framework replacement. The stated target is a terminal interface built with Spectre.Console, not a browser, mobile application, or native desktop window. Developers choosing RazorConsole need to accept terminal constraints such as available width, height, keyboard interaction, and terminal color support. The repository also does not document a rollback procedure, so deployment planning should not assume that reverading a package is as simple as changing one version line.
Component Architecture and Rendering Flow
RazorConsole is based on Razor components that render through Spectre.Console constructs. A component can be written in a `.razor` file, imported with RazorConsole component namespaces, and connected to an application host through `UseRazorConsole<Counter>()`. The README's basic example uses a `Counter` component with a `TextButton`, an event handler named `IncrementCount`, and a `Markup` element that displays the current value.
The event path is explicit. The button's `OnClick` property points to `IncrementCount`. When the interactive component receives the click, the handler changes `currentCount`, and the component then renders the updated value. The example also demonstrates how layout and presentation are separated: `Columns` arranges the label and value, while `TextButton` and `Markup` provide input and styled output.
Focus management is handled automatically according to the README. That matters for terminal applications because interactive controls need a usable keyboard model rather than only a visual representation. `Select`, `Scrollable`, and other controls are documented as supporting keyboard interaction. `Scrollable` is specifically described as enabling keyboard-based vertical scrolling, including nested components or HTML markup.
The architecture is suitable for stateful interfaces, but the available documentation does not specify threading behavior, terminal resize handling, or how component state is serialized. Those details should be checked in the examples or project-specific tests before relying on a component in a long-running process.
Installing RazorConsole and Starting the Counter
The README's installation step adds the core package to an existing .NET project:
dotnet add package RazorConsole.CoreThe package provides the RazorConsole core library. The project also needs the Razor SDK because RazorConsole uses Razor components. The README gives this project-file form:
<Project Sdk="Microsoft.NET.Sdk.Razor">
<!-- other settings -->
</Project>The project should then contain a Razor component such as `Counter.razor`, followed by a host in `Program.cs`. The following example is copied from the README and shows the application entry point:
using Microsoft.Extensions.Hosting;
using RazorConsole.Core;
IHostBuilder hostBuilder = Host.CreateDefaultBuilder(args)
.UseRazorConsole<Counter>();
IHost host = hostBuilder.Build();
await host.RunAsync();For the first real use, create the counter component with the imports and controls from the README. The component displays `Current count`, renders the value through `Markup`, and connects `TextButton` to `IncrementCount`:
@using Microsoft.AspNetCore.Components
@using Microsoft.AspNetCore.Components.Web
@using RazorConsole.Components
<Columns>
<p>Current count</p>
<Markup Content="@currentCount.ToString()" Foreground="@Spectre.Console.Color.Green" />
</Columns>
<TextButton Content="Click me"
OnClick="IncrementCount"
BackgroundColor="@Spectre.Console.Color.Grey"
FocusedColor="@Spectre.Console.Color.Blue" />
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}The expected first-use result is an interactive counter in the terminal. The displayed value starts at zero and increases when the button is activated. The README does not document a separate command for creating the project, so the exact project creation step is outside the documented tutorial.
RazorConsole Components for Input and Layout
RazorConsole's component set is divided into several practical groups. For input, the README lists `TextInput`, `TextButton`, and `Select`. These cover typed text, button activation, and keyboard-based option selection. For structure, it lists `Align`, `Columns`, `FlexBox`, `Rows`, `Grid`, `Padder`, `Scrollable`, and `ViewHeightScrollable`. These components address a common terminal problem: arranging content within a constrained rectangular display.
The display group is broader. `BarChart`, `BreakdownChart`, and `StepChart` cover different data presentation needs. `Table` supports structured rows and columns, while `Panel`, `Border`, `Markup`, `Markdown`, `SyntaxHighlighter`, and `Figlet` cover common presentation tasks. `SpectreCanvas` draws an array of pixels with different colors, which is unusual for a terminal library but directly relevant to terminal art or small graphical indicators.
`ModalWindow` is documented as a centered overlay using z-index positioning. `Spinner` provides animated progress indicators, and `Newline` adds spacing. These components suggest that RazorConsole is intended for interfaces with more state and presentation than a conventional prompt loop.
The README also documents hot reload. UI changes can be applied without restarting the application, which can shorten the edit-and-run cycle during development. That feature should not be confused with a documented production deployment mechanism. The repository layout includes examples for counters, file browsing, charts, galleries, Markdown, syntax highlighting, scrolling, selection, and terminal canvases. Those examples are useful references when the README does not explain a particular component in full.
Native AOT Nightlies and Release Maintenance
The repository is not archived, and the last push was on 2026-10-16. The listed recent releases are `nightly-20261013-212846-0e60f2c`, `nightly-20261008-032800-165c8cd`, and `nightly-20261008-014108-145f5cb`. Each is labeled as a RazorConsole Native AOT nightly. The README also links a stable NuGet package and a nightly NuGet package, but the repository data does not identify one of the listed nightly versions as the current stable release.
That distinction matters for adoption. A developer can use `RazorConsole.Core` through NuGet, but selecting the stable channel or a Native AOT nightly is a separate decision. The README does not document compatibility guarantees for Native AOT, reflection requirements, or the exact build configuration needed for an AOT application. The presence of nightly releases shows that Native AOT is part of the release activity, not that the nightly output is a stable production baseline.
The MIT license permits use under its terms, subject to the license text and applicable conditions. This review does not provide legal advice. Teams should review `LICENSE` and their own compliance obligations before redistribution. For maintenance planning, the key concrete signal is the 2026-10-16 push date. The repository is current enough not to appear abandoned, but the documented release information emphasizes nightlies rather than a clearly versioned stable AOT release.
Where RazorConsole Is the Wrong Choice
RazorConsole is the wrong choice when the required interface is not a terminal interface. Its components target Spectre.Console and the terminal's rendered surface. A project that needs a browser layout engine, ordinary web deployment, or native desktop controls should choose a UI framework for that environment instead.
It may also be unsuitable for a team that does not want to maintain Razor components or configure the Razor SDK. The setup requires changing the project SDK to `Microsoft.NET.Sdk.Razor`, and the counter tutorial depends on Razor imports, component code, and a host builder. A team seeking only static text output or a simple command-line interface may get more value from direct Spectre.Console use.
The Native AOT path needs careful review. The recent release names explicitly mention Native AOT, but the README does not document an AOT installation command or a complete AOT project configuration. That is a boundary in the available documentation, not proof that AOT is unsupported. Before choosing a nightly package for production, inspect the corresponding release package and verify that the components, input handling, and host integration required by the application work in the intended build mode.
Spectre.Console and RazorConsole as Complementary Choices
Direct Spectre.Console is the closest documented alternative because RazorConsole itself wraps Spectre.Console constructs. Spectre.Console provides terminal rendering and interaction primitives, while RazorConsole adds a Razor component model, reusable layout components, event-driven `.razor` files, and automatic focus management for the documented interactive controls.
A project that only needs a table, prompt, spinner, or fixed sequence of terminal output can remain closer to direct Spectre.Console. That avoids introducing Razor components and the Razor SDK requirement. RazorConsole becomes more relevant when several controls must share state, when the interface has a component hierarchy, or when developers want Razor's event-handler and lifecycle patterns.
The trade-off is added framework and release considerations. Direct Spectre.Console usage leaves the application responsible for composing the terminal output. RazorConsole provides higher-level components, including `Select`, `TextInput`, `ModalWindow`, and `ViewHeightScrollable`, but users also inherit the package's component API and its release channel choices. The repository includes a gallery package, and the README documents a global `razorconsole-gallery` command for viewing live examples. That gallery can help assess component behavior before integrating a control into an application.
Editorial conclusion
RazorConsole is a reasonable fit for.NET developers building interactive terminal applications with Razor components, especially when Spectre.Console output and a component-based UI model are already desired. It is less suitable for projects that need a documented, stable Native AOT release or a browser or desktop UI target. Evaluate the Razor SDK requirement, the current NuGet release selected, and the behavior of the required input components before adopting it. The repository's last push was on 2026-10-16, but the listed releases are nightly builds rather than a clearly identified stable release.
Frequently asked questions
How do I install RazorConsole?
Add the core package with `dotnet add package RazorConsole.Core`. The project file must use the `Microsoft.NET.Sdk.Razor` SDK so Razor components can compile.
What components does RazorConsole provide?
The README lists layout, input, display, and utility components. Examples include `TextInput`, `TextButton`, `Select`, `Table`, `BarChart`, `ModalWindow`, `Scrollable`, `Spinner`, and `SyntaxHighlighter`.
Does RazorConsole support Native AOT?
Recent releases are labeled RazorConsole Native AOT nightlies, including `nightly-20261013-212846-0e60f2c`. The README does not provide a complete Native AOT setup tutorial or state which listed nightly is stable.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/razorconsole-razorconsole)Was this useful?