Namespace MiniTui
Classes
- AnsiBackend
The default backend: writes ANSI/VT escape sequences to standard output (§5.2–5.3). Uses the alternate screen, so the user's screen and scrollback are untouched.
- App
Fluent builder for creating TUI applications. Builder methods mutate the app and return it.
- Axis
One axis of a ChartBuilder (1.x spec §8.4).
- Bar
A bar in a BarChartBuilder (1.x spec §8.5).
- BarChartBuilder
Labelled bars, vertical (growing up) or horizontal (growing right), in eighths of a cell (1.x spec §8.5), or groups of them side by side or stacked, with a legend of their series (§19.3).
- BarGroup
Several bars under one label, side by side or stacked into one bar (1.x spec §19.3).
- BlockBuilder
A border with optional titles and padding, drawn around other widgets.
- Buffer
Off-screen buffer for rendering. This is your canvas.
- ButtonBuilder
A button with a centered label.
- CanvasBuilder
A drawing surface in app coordinates: x grows to the right and y grows upward (1.x spec §8.3). Shapes are passed to Paint(Action<CanvasPainter>), which runs on every draw.
- CanvasPainter
Passed to Paint(Action<CanvasPainter>). Shapes are drawn in call order (1.x spec §8.3).
- ChartBuilder
A line or scatter plot of one or more datasets, with axes, labels and a legend (1.x spec §8.4).
- ChartTime
Times as chart values: seconds since the Unix epoch, and durations as seconds (1.x spec §19.4).
- CheckboxBuilder
A checkbox with a label:
[✓] Label.
- Clipboard
The clipboard that copy, cut and Ctrl+V in text fields and text areas use (1.x spec §10.5). Text set here is always kept as the in-app clipboard, and also goes to the system clipboard where the platform and terminal allow it: the Win32 clipboard on Windows, and OSC 52 on Unix terminals, while an app is running.
- ColorCapability
Detects how many colors the terminal supports from the environment (§4.2).
- CommandBuilder
Fluent builder for configuring a command.
- CommandLineBuilder
A command input: a prompt followed by a text field with history (see CommandLineState).
- CommandLineOverlay
A
:command line for a CommandRegistry, shown at the bottom of the screen. Enter runs the command and shows its message as a toast; Esc closes. Not bound by default:app.Keys.Add(":", "Command", () => app.Overlays.Show(new CommandLineOverlay(registry))).
- CommandLineState
A text field with command history: Enter submits, ↑/↓ recall history, Esc clears a selection, or else the text (§8.4, 1.x spec §10.3).
- CommandPalette
A searchable list of things to run (1.x spec §13). Typing filters the items with Match(string, string); ↑ ↓ PgUp PgDn Ctrl+Home Ctrl+End move the selection; Enter or a click runs the selected item; Esc or a click outside closes it. Show it with ShowPalette(CommandRegistry?), or with Show(Overlay) for items of your own.
- CommandRegistry
Registry for commands with fluent configuration and execution.
- CommandResult
Result of executing a command.
- Component
A piece of UI that holds state, handles keys and renders itself every frame (§9.1). Components stay immediate-mode: a parent renders its children explicitly with
ctx.Render(child, buf, rect), which also records where the child is for the mouse.
- ComponentHarness
Runs a screen in a test (§9.6): an app on a TestBackend with scripted input, driven one loop iteration at a time on the calling thread. It never touches the real console.
- ConfirmDialog
A yes/no question, used by ConfirmAsync(string, string, string). ← → Tab h l switch buttons; Enter picks the selected one;
yanswers yes;nand Esc answer no.
- ConsoleInputSource
Reads keys from Console. This was the default before 1.1; TerminalInputSource is now.
- Constraint
How much space a layout region gets along the layout's axis (§7).
- Dataset
A series of (x, y) values for a ChartBuilder (1.x spec §8.2).
- Event
Something the app loop delivers to OnEvent(Action<Event>).
- FocusScope
The focusable children of a component, in tab order (§9.2). The focus chain starts at the top screen and follows Focused from each component until it reaches one whose scope is empty.
- Fuzzy
Fuzzy matching, as in CommandPalette (1.x spec §13.5).
- GaugeBuilder
A progress bar with eighth-cell precision and a centered label.
- HelpOverlay
The key bindings in scope, grouped by component (§9.5). Shown by ShowHelp() and the built-in
?binding.?,q, Enter or Esc closes it.
- KeyEvent
A key press.
- KeyMap
Key bindings with descriptions, for handling keys and showing hints and help (§8.5).
- Layout
Fluent builder for creating layouts with named regions (§7).
- LegacyConsoleBackend
Fallback backend for consoles without VT support (§5.6), using the Console API. Limited to 16 colors; no alternate screen or synchronized output. Reversed is emulated by swapping colors; other modifiers aren't shown.
- Line
A single line of styled spans.
- ListBuilder
A bordered, scrollable list with a selection.
- Loadable<T>
The state of an async load, for rendering loading, loaded and failed states (§6.4). State only changes on the app's UI thread, and every change requests a redraw.
- LogBuffer
A thread-safe ring buffer of log lines. While an app runs with console capture on (the default), everything written to Out and Error lands here (§6.6).
- MenuBar
A row of menus along the top of the screen (1.x spec §15.5). F10 opens the first menu, Alt and a title's mnemonic opens that one, and a click on a title opens or closes it; ← → move between the menus. Set it with WithMenuBar(MenuBar?).
- MessageDialog
A scrollable message, used by ShowMessageAsync(string, Text). Enter or Esc closes it.
- MouseEvent
A mouse report, delivered while WithMouse(bool) is on (1.x spec §4).
XandYare 0-based cells, like Buffer coordinates.
- Overlay
A modal component drawn over the screens, inside a themed block. While any overlay is open, the top one gets every key.
- OverlayStack
Modal overlays drawn over the screens (§9.3). While any is open, the top one gets every key.
- PaletteItem
An item in a CommandPalette (1.x spec §13.3).
- Paragraph
Measuring text the way ParagraphBuilder lays it out.
- ParagraphBuilder
Multi-line text with optional wrapping, alignment and scrolling.
- ParsedCommand
A parsed command with name and arguments.
- PasteEvent
A paste from the terminal (bracketed paste, 1.x spec §3). Line breaks are normalized to "\n".
- PopupMenu
A menu overlay next to an anchor (1.x spec §7, §15). ↑ ↓ PgUp PgDn Home End and type-ahead move the selection; an item's mnemonic chooses it; Enter or a click chooses an item; → or Enter opens a submenu and ← closes it; Esc, Tab or a click outside dismisses the menu. Show it with ShowMenuAsync(IReadOnlyList<MenuItem>, Rect, int), or with Show(Overlay) and await Result or Chosen.
- RenderContext
What a component needs to know while rendering: whether it's focused, the theme and the app.
- ResizeEvent
The terminal was resized. The next frame is a full redraw.
- ResumeEvent
The app took the terminal back (1.x spec §5): after Suspend(Action), after the process was stopped and continued, and after a SIGCONT the app didn't cause. The next frame is a full redraw.
- Row
A table row: one line per cell, with an optional style for the whole row.
- Screen
A full-screen component on the app's ScreenStack. Only the top screen renders and gets keys.
- ScreenStack
The app's screens (§9.3). Only the top screen renders and receives keys; the ones below keep their state.
- ScriptedInputSource
An input source fed by code, for tests. Thread-safe.
- ScrollState
The scroll position of scrollable text, such as a ParagraphBuilder or a modal. The widget writes ViewportHeight and ContentHeight and clamps Offset while drawing.
- ScrollbarBuilder
A scrollbar, drawn along the right edge (vertical) or bottom edge (horizontal) of its area. Hidden when the content fits in the viewport.
- SelectBuilder
A dropdown field (1.x spec §7.5): the chosen option, or a muted placeholder, and a ▼ at the right edge.
- SelectState
The options and choice of a dropdown field (1.x spec §7.5), drawn with Select(). Opening it shows a PopupMenu of the options below the field.
- SelectionState
The selected row and scroll offset of a list or table (§8.2). The widget clamps Selected and adjusts Offset while drawing, so the selection is always visible.
- SparklineBuilder
A bar chart of recent values in one row (or more) of
▁▂▃▄▅▆▇█, newest at the right.
- SpinnerBuilder
An activity indicator. It's stateless: the frame comes from the app's clock, and while a spinner is drawn the app ticks every 100 ms so it animates.
- SplitBuilder
Two panes with a divider between them (1.x spec §14.3), from a SplitState. Draw(Buffer, Rect) draws only the divider and returns the panes for the app to draw into.
- SplitState
The divider position of a split (1.x spec §14.3), drawn with Split(SplitState). The panes are sized by Ratio, so they keep their proportions when the terminal is resized, or with one pane at a fixed size in cells (FixedSize, a sidebar), the other taking the rest. The user drags the divider, or moves it with Alt+Shift and the arrows.
- StatusBarBuilder
A one-row bar with left- and right-aligned text.
- TabBarBuilder
A row of tabs. When they don't fit, the bar scrolls to keep the selected tab visible.
- TabBarState
The selected tab of a TabBarBuilder. The widget writes Count while drawing.
- TableBuilder
A table with a header, constraint-sized columns and a scrolling selection (§8.3). Only the visible rows are formatted, so the cost per frame doesn't depend on the row count.
- Terminal
Manages the actual terminal - handles double-buffering and efficient rendering. Only changed cells are sent to the ITerminalBackend.
- TerminalInfo
What the terminal said about itself in reply to the startup queries (1.x spec §12.3). Unknown values are null.
- TerminalInfoEvent
Raised through OnEvent(Action<Event>) when TerminalInfo changes because a reply to the startup queries arrived (1.x spec §12.3).
- TerminalInputSource
The default input source: on Linux and macOS it puts the terminal in raw mode, and on Windows the console in VT input mode, and decodes the input bytes itself, so Esc, Alt, function keys and modifier combinations decode the same way everywhere, and a key sequence split across reads is reassembled instead of producing a stray Esc. It also turns on bracketed paste, so a paste arrives as one PasteEvent instead of keys. Conhost has no bracketed paste, so there Ctrl+V pastes the clipboard's text as a PasteEvent. Wherever raw or VT input isn't available, it reads keys like ConsoleInputSource, and pasted text arrives as keys.
- TerminalLease
A share of the terminal session. Disposing the last lease restores the terminal.
- TerminalNotSupportedException
Thrown when MiniTui can't run, for example because stdin or stdout is redirected.
- TestBackend
An in-memory terminal for testing apps. It applies each frame's changed cells to a grid, so Lines and CellAt(int, int) show what a real terminal would display.
- Text
Multi-line styled text.
- TextAreaBuilder
A multi-line text input (1.x spec §6). Long lines wrap; the view scrolls vertically to keep the cursor visible, and when focused shows the terminal cursor at the insertion point.
- TextAreaState
The text and cursor of a multi-line text area (1.x spec §6). The text is a list of lines; the cursor is a line and a UTF-16 index that is always on a grapheme cluster boundary, so editing never splits a character.
- TextFieldBuilder
A single-line text input. It scrolls horizontally by display width to keep the cursor visible, and when focused shows the terminal cursor at the insertion point.
- TextFieldState
The text and cursor of a single-line text field (§8.4). The cursor is a UTF-16 index that is always on a grapheme cluster boundary, so editing never splits a character.
- Theme
The styles widgets draw with (§8.1). Backgrounds are left to the terminal except for bars, buttons and selections, so light and custom terminal themes show through.
- TickEvent
A tick from WithTickRate(TimeSpan?).
Elapsedis the time since the previous tick.
- ToastQueue
Short messages that pop up in the top-right corner and disappear on their own. Draw them with Toasts(). Thread-safe.
- ToastsBuilder
Draws a ToastQueue in the top-right corner of the area, usually the whole screen.
- TreeBuilder<T>
A bordered, scrollable tree with a selection (1.x spec §11.5).
- TreeNodeEventArgs<T>
The node a tree event is about.
- TreeState
Creating a TreeState<T> whose children load asynchronously.
- TreeState<T>
The rows, expanded nodes, selection and scroll offset of a tree (1.x spec §11), drawn with Tree<T>(TreeState<T>).
Tis the app's own node type: the state asks for each expanded node's children instead of holding a copy of the tree.
- UnicodeWidth
Display width of text in terminal columns, by grapheme cluster (UAX #29). Width tables come from Unicode 16.0; see
tools/GenWidthTable.cs.
- Widget
Factory methods for widget builders.
Structs
- Cell
A single terminal cell: one grapheme cluster plus its colors and modifiers. A wide (two-column) cell is followed by a continuation cell whose Symbol is empty.
- CellUpdate
A cell to draw at a position.
- Color
A terminal color: the terminal default, one of the 16 named colors, a 256-color palette index, or RGB.
default(Color)is Reset.
- FrameStats
One frame's numbers (1.x spec §9.4).
- FuzzyMatch
A successful Match(string, string): higher scores are better matches.
- KeyBinding
One key combination, such as
q,ctrl+rorshift+tab(§8.5).
- Margin
Spacing on each side of a rect.
- Rect
Rectangle defined by position and size.
- Span
A run of text with a single style.
- Style
A patch of cell attributes. Drawing with a style changes only what the style specifies: a null Fg or Bg keeps the cell's existing color.
- TextPosition
A position in a TextAreaState: a line, and a UTF-16 index into it on a grapheme cluster boundary.
- TimedMessage
A timed message that expires after a duration.
- TreeRow<T>
One visible row of a tree: a node, its parent (null for a root) and its depth (0 for a root).
- Vec2
2D integer vector for positions and sizes.
Interfaces
- IInputSource
A source of key presses.
- ITerminalBackend
Where frames go: a real terminal, the legacy console API, or an in-memory grid for tests. Terminal owns the double buffer and diffing, and passes the backend only the changed cells.
Enums
- Alignment
Horizontal alignment of a line within its area.
- Borders
Which sides of a BlockBuilder have a border.
- BoxStyle
Box drawing styles using Unicode box-drawing characters.
- ColorMode
How many colors the terminal can display. Colors are downsampled to this mode when encoded.
- Direction
The axis a layout splits along.
- ErrorAction
What the app does after OnError(Func<Exception, ErrorAction>) sees an exception.
- Flex
Where leftover space goes when no region can grow into it.
- KeyboardProtocol
How the terminal encodes keys (1.x spec §12.5).
- LegendPosition
Where a ChartBuilder draws its legend.
- LoadStatus
Where a Loadable<T> is in its load cycle.
- Marker
How a canvas turns dots into cells (1.x spec §8.3).
- Modifiers
Text attributes that can be added to or removed from a cell.
- MouseAction
What happened in a MouseEvent.
- MouseButton
A mouse button, in a MouseEvent.
- SpinnerFrames
The animation frames of a SpinnerBuilder.
- ToastLevel
The kind of a toast, which sets its border color.
- WrapMode
How a ParagraphBuilder breaks lines that are wider than its area.