Skip to content

TerminaReactive TUI Framework for .NET

Build beautiful terminal applications with declarative layouts and reactive state management

Termina

Quick Install

shell
dotnet add package Termina
xml
<PackageReference Include="Termina" Version="0.2.*" />
NuGetDownloads

Quick Example

csharp
// Define a ViewModel with reactive properties
public partial class CounterViewModel : ReactiveViewModel
{
    [Reactive] private int _count;

    public override void OnActivated()
    {
        Input.OfType<KeyPressed>()
            .Subscribe(key =>
            {
                if (key.KeyInfo.Key == ConsoleKey.UpArrow) Count++;
                if (key.KeyInfo.Key == ConsoleKey.DownArrow) Count--;
                if (key.KeyInfo.Key == ConsoleKey.Q) Shutdown();
            })
            .DisposeWith(Subscriptions);
    }
}

// Define a Page with declarative layout
public class CounterPage : ReactivePage<CounterViewModel>
{
    protected override ILayoutNode BuildLayout()
    {
        return Layouts.Vertical()
            .WithChild(
                new PanelNode()
                    .WithTitle("Counter")
                    .WithContent(
                        ViewModel.CountChanged
                            .Select(c => new TextNode($"Count: {c}").Bold())
                            .AsLayout()
                    )
            )
            .WithChild(
                new TextNode("Press ↑/↓ to change, Q to quit")
                    .WithForeground(Color.Gray)
            );
    }
}

Why Termina?

Termina brings modern application development patterns to terminal UIs:

  • Reactive by default - UI automatically updates when state changes
  • Familiar patterns - If you know ASP.NET Core or WPF/MAUI, you'll feel at home
  • Testable - VirtualInputSource lets you write automated tests for your TUI
  • Performant - Only changed regions are re-rendered, not the entire screen
  • Production-ready - AOT compilation, proper error handling, async support

Released under the Apache 2.0 License.