A terminal UI backend for .NET MAUI. Write your app with the familiar MAUI API — ContentPage, Button, Label, Grid, etc. — and render it in your terminal.
Built on XenoAtom.Terminal.UI for high-performance terminal rendering.
MAUI-TUI-Demo.mov
- Full MAUI handler pipeline — uses the standard
ViewHandler<TVirtualView, TPlatformView>architecture, no fork required - 25+ control handlers — Label, Button, Entry, Editor, CheckBox, Switch, Slider, ProgressBar, Picker, DatePicker, TimePicker, Stepper, RadioButton, CollectionView, ActivityIndicator, ScrollView, Border, Frame, and more
- Layout support — VerticalStackLayout, HorizontalStackLayout, Grid, AbsoluteLayout, FlexLayout via MAUI's cross-platform layout engine
- Navigation — NavigationPage (push/pop), TabbedPage, FlyoutPage, modal pages
- Alerts & dialogs —
DisplayAlert,DisplayActionSheet,DisplayPromptAsyncrendered as TUI modal dialogs - SVG rendering — render your UI to SVG for testing and documentation (
--svg) - Visual tree dump — inspect the rendered control tree for debugging (
--dump)
- .NET 10 SDK (preview)
- MAUI workload:
dotnet workload install maui
dotnet new console -n MyTuiApp
cd MyTuiApp<ProjectReference Include="path/to/src/Maui.TUI/Maui.TUI.csproj" />// MauiProgram.cs
using Maui.TUI.Hosting;
using Microsoft.Maui.Hosting;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp
.CreateBuilder()
.UseMauiAppTUI<App>();
return builder.Build();
}
}// App.cs
using Microsoft.Maui.Controls;
class App : Application
{
protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new ContentPage
{
Title = "Hello TUI",
Content = new VerticalStackLayout
{
Children =
{
new Label { Text = "Hello, .NET MAUI TUI!" },
new Button { Text = "Click me" },
}
}
});
}
}// Program.cs
using Maui.TUI;
public class MyApp : MauiTuiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
var app = new MyApp();
app.Run();Press Ctrl+Q to exit the terminal app.
./run-sample.shOr directly:
cd samples/Maui.TUI.Sample
dotnet runThe sample app demonstrates tabbed pages with controls, collection views, navigation, modals, and a form — all running in the terminal.
# Dump the visual tree to stderr
dotnet run -- --dump
# Render the UI to SVG
dotnet run -- --svgsrc/Maui.TUI/ # Core library
Handlers/ # MAUI ViewHandler implementations (one per control)
Hosting/ # AppHostBuilder extensions (UseMauiAppTUI)
Platform/ # TUI platform infrastructure
MauiTuiApplication.cs # Application lifecycle & terminal loop
TuiMauiContext.cs # IMauiContext implementation
TuiDispatcherProvider.cs # Dispatcher for terminal thread
TuiAlertManager.cs # Alert/dialog/prompt handling
samples/Maui.TUI.Sample/ # Sample app with multiple demo pages
docs/ # Design documents & proposals
Maui.TUI implements the MAUI handler architecture for terminal rendering:
- Handlers map each MAUI virtual view (
ILabel,IButton, etc.) to a XenoAtom.Terminal.UI visual (e.g.TextBlock,Button) - Layout delegates to MAUI's
CrossPlatformMeasure/CrossPlatformArrange— the cross-platform layout engine works out of the box - Bootstrap wires up the MAUI DI pipeline, handler factory, and dispatcher, then runs the
TerminalApploop - Navigation manages a stack of page containers, swapping content for push/pop operations
- Alerts intercept MAUI's internal
AlertManagervia DI and render modalDialogcontrols
MIT — Copyright (c) 2026 Jonathan Dick