Hex1b 0.106.0
dotnet add package Hex1b --version 0.106.0
NuGet\Install-Package Hex1b -Version 0.106.0
<PackageReference Include="Hex1b" Version="0.106.0" />
<PackageVersion Include="Hex1b" Version="0.106.0" />
<PackageReference Include="Hex1b" />
paket add Hex1b --version 0.106.0
#r "nuget: Hex1b, 0.106.0"
#:package Hex1b@0.106.0
#addin nuget:?package=Hex1b&version=0.106.0
#tool nuget:?package=Hex1b&version=0.106.0
Hex1b
Hex1b is a .NET library for building TUI apps using an approachable code-first API.
Installation
dotnet add package Hex1b
Quick Start
Hello World
A minimal application that displays text and a quit button:
using Hex1b;
using var app = new Hex1bApp(ctx =>
ctx.VStack(b => [
b.Text("Hello, Terminal!"),
b.Button("Quit").OnClick(e => e.Context.RequestStop())
])
);
await app.RunAsync();
Counter with State
An interactive counter demonstrating mutable state across renders:
using Hex1b;
// State persists outside the builder function
var count = 0;
using var app = new Hex1bApp(ctx =>
ctx.VStack(b => [
b.Text($"Count: {count}"),
b.Button("Increment").OnClick(_ => count++),
b.Button("Decrement").OnClick(_ => count--),
b.Text(""),
b.Button("Quit").OnClick(e => e.Context.RequestStop())
])
);
await app.RunAsync();
Counter with Custom Key Bindings
A counter controlled with custom keyboard shortcuts (Ctrl+A to increment, Ctrl+D to decrement):
using Hex1b;
using Hex1b.Input;
var count = 0;
using var app = new Hex1bApp(ctx =>
ctx.VStack(b => [
b.Text($"Count: {count}"),
b.Text(""),
b.Text("Ctrl+A: Increment"),
b.Text("Ctrl+D: Decrement"),
b.Text("Ctrl+Q: Quit")
]).WithInputBindings(bindings =>
{
bindings.Ctrl().Key(Hex1bKey.A).Action(() => count++, "Increment counter");
bindings.Ctrl().Key(Hex1bKey.D).Action(() => count--, "Decrement counter");
bindings.Ctrl().Key(Hex1bKey.Q).Action(ctx => ctx.RequestStop(), "Quit");
})
);
await app.RunAsync();
Layout System
Hex1b uses a constraint-based layout system with size hints:
// Vertical stack with flexible sizing
new VStackWidget(
children: [contentWidget, statusBarWidget],
sizeHints: [SizeHint.Fill, SizeHint.Content]
);
Size Hints:
SizeHint.Fill– Expand to fill available spaceSizeHint.Content– Size to fit contentSizeHint.Fixed(n)– Fixed size of n unitsSizeHint.Weighted(n)– Proportional sizing with weight n
Widgets
| Widget | Description |
|---|---|
TextBlockWidget |
Display static or dynamic text |
TextBoxWidget |
Editable text input with cursor and selection |
ButtonWidget |
Clickable button with label and action |
ListWidget |
Scrollable list with selection support |
VStackWidget |
Vertical layout container |
HStackWidget |
Horizontal layout container |
SplitterWidget |
Resizable split pane layout |
BorderWidget |
Container with border and optional title |
ScrollPanelWidget |
Scrollable content area |
Input Bindings
Define keyboard shortcuts using the fluent builder API:
widget.WithInputBindings(bindings =>
{
// Simple key
bindings.Key(Hex1bKey.Delete).Action(() => DeleteItem());
// Modifier keys (Ctrl or Shift, but not both)
bindings.Ctrl().Key(Hex1bKey.S).Action(() => Save(), "Save");
bindings.Shift().Key(Hex1bKey.Tab).Action(() => FocusPrevious(), "Previous");
// Multi-step chords
bindings.Ctrl().Key(Hex1bKey.K)
.Then().Key(Hex1bKey.C)
.Action(() => CommentLine(), "Comment line");
});
Theming
Apply built-in themes or create your own:
using Hex1b.Theming;
using var app = new Hex1bApp(
builder,
new Hex1bAppOptions { Theme = Hex1bThemes.Sunset }
);
Documentation
License
Hex1b is licensed under the MIT License.
| 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 was computed. 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 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- QRCoder (>= 1.7.0)
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 |
|---|---|---|
| 0.106.0 | 34 | 3/4/2026 |
| 0.105.0 | 55 | 3/4/2026 |
| 0.104.0 | 124 | 3/3/2026 |
| 0.103.0 | 202 | 3/2/2026 |
| 0.102.0 | 80 | 3/2/2026 |
| 0.101.0 | 85 | 3/2/2026 |
| 0.100.0 | 80 | 3/2/2026 |
| 0.99.0 | 184 | 2/26/2026 |
| 0.98.0 | 116 | 2/25/2026 |
| 0.97.0 | 116 | 2/23/2026 |
| 0.96.0 | 151 | 2/23/2026 |
| 0.95.0 | 90 | 2/23/2026 |
| 0.94.0 | 102 | 2/22/2026 |
| 0.93.0 | 87 | 2/22/2026 |
| 0.92.0 | 133 | 2/21/2026 |
| 0.91.0 | 226 | 2/19/2026 |
| 0.90.0 | 323 | 2/17/2026 |
| 0.89.0 | 98 | 2/17/2026 |
| 0.88.0 | 111 | 2/16/2026 |
| 0.87.0 | 267 | 2/16/2026 |
See https://github.com/hex1b/hex1b/releases for release notes.