XenoAtom.Terminal.UI

repository·main·Indexed 42 days ago

https://github.com/xenoatom/xenoatom.terminal.ui

A reactive, retained-mode terminal user interface framework for .NET 10 (C# 14). It enables the creation of inline terminal widgets and complex fullscreen applications using a binding-first UI model. Features include a rich set of over 60 built-in controls (such as DataGridControl, CodeEditor, and various layout stacks), support for Nerd Font glyphs, and a Brush API for linear gradients. Built on top of XenoAtom.Terminal for ANSI/markup output and input events.

Tokens
178K
Snippets
429
Records
889
Agent score
54%

What's inside XenoAtom.Terminal.UI

  1. Overview of XenoAtom.Terminal.UI.Text

    main

    The XenoAtom.Terminal.UI.Text module provides the core text model and editing infrastructure required for text-oriented controls in the terminal. It is designed to handle complex text editing scenarios by providing abstractions for:

    • Document management: Representing the text content.
    • Snapshots: Capturing states of the text.
    • Selection: Managing text ranges and cursors.
    • Undo/Redo: Providing history management for text edits.
    • Parsing: Helpers for interpreting text structures.
  2. Overview of the XenoAtom.Terminal.UI core namespace

    main

    The XenoAtom.Terminal.UI namespace is the core of the retained-mode terminal UI framework. It provides the fundamental primitives required to build terminal interfaces, including:

    • Visuals: The base primitives for rendering and layout.
    • Bindings: Mechanisms for connecting data to the UI.
    • App Loop: The central execution loop that manages the application lifecycle.
    • Integration Entry Points: Methods and classes used to host the UI within an application.
  3. Overview of XenoAtom.Terminal.UI.Extensions.Markdown

    main

    The XenoAtom.Terminal.UI.Extensions.Markdown package provides a markdown integration layer for XenoAtom.Terminal.UI. It enables the parsing of Markdown content and its conversion into the terminal UI's internal document-flow model.

    Key capabilities include:

    • Parsing: Converting Markdown text into structured data.
    • Document-flow conversion: Mapping Markdown elements to DocumentFlow, Paragraph, and other terminal UI controls.
    • Markup conversion: Providing helpers to transform markup into renderable terminal components.

    The extension is built on top of the Markdig library and supports CommonMark along with selected extensions, optimized for efficient rendering within a terminal environment.

  4. Overview of the XenoAtom.Terminal.UI Styling System

    main

    The XenoAtom.Terminal.UI.Styling system provides a framework for customizing the visual appearance of terminal controls. It is built around three core pillars:

    1. Themes: Composable sets of visual rules that define the overall look and feel of the UI.
    2. Style Keys: Named identifiers used to reference specific visual configurations across different controls.
    3. Visual Effects: Support for advanced terminal rendering including Brushes (solid colors/patterns) and Gradients.
  5. Overview of XenoAtom.Terminal.UI

    main

    XenoAtom.Terminal.UI is a modern retained-mode terminal UI framework built on top of XenoAtom.Terminal. It provides two primary modes of operation:

    1. Inline Widgets: Rendered as part of normal terminal output using Terminal.Write or Terminal.Live.
    2. Fullscreen Applications: Utilizes the alternate screen, supporting focus navigation with configurable tab stops, routed input, dialogs, and complex controls like DataGridControl and TabControl.
  6. Overview of XenoAtom.Terminal.UI.Controls

    main

    The XenoAtom.Terminal.UI.Controls namespace provides the built-in library of controls and visual components used to compose terminal user interfaces. It offers a range of components from low-level layout containers to high-level interactive widgets.

    Available component categories include:

    • Layout Containers: For structuring the UI hierarchy.
    • Input Controls: For capturing user input.
    • Overlays: For displaying transient information or modal states.
    • Charts: For data visualization within the terminal.
    • Interactive Widgets: Higher-level, ready-to-use UI elements.
  7. Use high-level prompt abstractions for terminal interaction

    main

    The XenoAtom.Terminal.UI.Prompts library provides high-level, reusable prompt abstractions built on top of standard terminal UI controls. Instead of manually managing low-level controls, you can use these specialized prompt types to handle common user interaction patterns:

    • Confirmations: For yes/no or boolean decisions.
    • Selection: For choosing from a list of options.
    • Text Input: For capturing string data from the user.
    • Numeric Entry: For capturing integer or decimal values.

    These prompts are designed to be integrated into terminal applications to provide a consistent and intuitive user experience.

  8. Browse available terminal UI controls

    main

    The xenoatom.terminal.ui library provides a comprehensive set of controls categorized by their functional purpose. You can find detailed specifications for each control in the documentation to understand their behavior, properties, and usage patterns.

    Control Categories

    • Text input: Controls for capturing and validating user text (e.g., TextBox, TextArea, MaskedInput, NumberBox, ColorPicker).
    • Buttons & toggles: Action-oriented controls (e.g., Button, CheckBox, RadioButton, Switch, Link).
    • Lists & selection: Controls for selecting items from a collection (e.g., ListBox, TreeView, Select, Slider).
    • Layout & containers: Structural components for organizing the UI (e.g., VStack, HStack, Grid, DockLayout, Border, Group).
    • Scrolling: Mechanisms for handling content overflow (e.g., ScrollViewer, ScrollBar).
    • Navigation & chrome: High-level UI framework components (e.g., TabControl, MenuBar, CommandPalette, StatusBar).
    • Data display: Components for presenting information (e.g., Table, DataGridControl, TextBlock, MarkdownControl, ProgressBar, Charts).
    • Overlays: Transient UI elements (e.g., Popup, Dialog, Tooltip, Toast).
    • Shared subsystems: Integrated systems like the Menu System (combining MenuBar and context menus).