FractalDataWorks.TUI.Abstractions 0.1.0-preview.11

This is a prerelease version of FractalDataWorks.TUI.Abstractions.
dotnet add package FractalDataWorks.TUI.Abstractions --version 0.1.0-preview.11
                    
NuGet\Install-Package FractalDataWorks.TUI.Abstractions -Version 0.1.0-preview.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FractalDataWorks.TUI.Abstractions" Version="0.1.0-preview.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FractalDataWorks.TUI.Abstractions" Version="0.1.0-preview.11" />
                    
Directory.Packages.props
<PackageReference Include="FractalDataWorks.TUI.Abstractions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FractalDataWorks.TUI.Abstractions --version 0.1.0-preview.11
                    
#r "nuget: FractalDataWorks.TUI.Abstractions, 0.1.0-preview.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FractalDataWorks.TUI.Abstractions@0.1.0-preview.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FractalDataWorks.TUI.Abstractions&version=0.1.0-preview.11&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FractalDataWorks.TUI.Abstractions&version=0.1.0-preview.11&prerelease
                    
Install as a Cake Tool

FractalDataWorks.TUI.Abstractions

Theme and renderer abstractions for the FractalDataWorks TUI menu system.

Overview

This package defines the contracts for building terminal-based user interfaces that are renderer-agnostic. It provides interfaces for page models, components, and a TypeCollection-based renderer system.

Installation

<PackageReference Include="FractalDataWorks.TUI.Abstractions" Version="x.x.x" />

Dependencies

  • FractalDataWorks.Abstractions
  • FractalDataWorks.Collections
  • FractalDataWorks.UI.Abstractions
  • FractalDataWorks.UI.Themes
  • Spectre.Console

Key Types

Components

From IComponentModel.cs:6-48:

public interface IComponentModel
{
    string Id { get; }
    string? Label { get; }
    string? HelpText { get; }
    bool IsRequired { get; }
    bool IsReadOnly { get; }
    bool IsVisible { get; }
    int Order { get; }
    ValidationResult Validate();
}

From IInputComponentModel.cs:9-25:

public interface IInputComponentModel<T> : IComponentModel
{
    T? Value { get; set; }
    T? DefaultValue { get; }
    Func<T?, ValidationResult>? CustomValidator { get; }
}

Page Structure

From IPageModel.cs:9-35:

public interface IPageModel
{
    string Id { get; }
    string Title { get; }
    string? Description { get; }
    IReadOnlyList<ISectionModel> Sections { get; }
    IPageMode Mode { get; }
}

From ISectionModel.cs:8-34:

public interface ISectionModel
{
    string Id { get; }
    string? Title { get; }
    bool IsCollapsible { get; }
    bool IsExpanded { get; set; }
    IReadOnlyList<IColumnModel> Columns { get; }
}

From IColumnModel.cs:8-24:

public interface IColumnModel
{
    string Id { get; }
    int Width { get; }  // 1-12 grid system
    IReadOnlyList<IComponentModel> Components { get; }
}

Rendering

From IUIRenderer.cs:15-73:

public interface IUIRenderer : ITypeOption<int, UIRendererBase>
{
    bool SupportsInteractiveMode { get; }
    bool SupportsAnsiColors { get; }
    bool SupportsFocusManagement { get; }
    bool SupportsHotReload { get; }

    Task<RenderResult> Render(
        IComponentModel model,
        IRenderContext context,
        CancellationToken cancellationToken = default);

    Task<PromptResult<T>> Prompt<T>(
        IInputComponentModel<T> model,
        IRenderContext context,
        CancellationToken cancellationToken = default);

    Task<PageResult> RenderPage(
        IPageModel page,
        IRenderContext context,
        CancellationToken cancellationToken = default);
}

From IRenderContext.cs:8-44:

public interface IRenderContext
{
    IMenuTheme Theme { get; }
    RenderMode Mode { get; }
    int ConsoleWidth { get; }
    int ConsoleHeight { get; }
    bool SupportsAnsiColors { get; }
    bool SupportsUnicode { get; }
    string? FocusedComponentId { get; }
}

From RenderMode.cs:6-22:

public enum RenderMode
{
    Display = 0,
    Edit = 1,
    ReadOnly = 2
}

Result Types

From RenderResult.cs:6-34:

public sealed class RenderResult
{
    public bool Success { get; }
    public string? ErrorMessage { get; }

    public static RenderResult Ok() => new(true);
    public static RenderResult Fail(string errorMessage) => new(false, errorMessage);
}

From ValidationResult.cs:8-42:

public sealed class ValidationResult
{
    public bool IsValid { get; }
    public IReadOnlyList<string> Errors { get; }

    public static ValidationResult Valid() => new(true, null);
    public static ValidationResult Invalid(string error) => new(false, [error]);
    public static ValidationResult Invalid(IReadOnlyList<string> errors) => new(false, errors);
}

Architecture

IPageModel
├── Sections: IReadOnlyList<ISectionModel>
│   └── Columns: IReadOnlyList<IColumnModel> (12-column grid)
│       └── Components: IReadOnlyList<IComponentModel>

UIRenderers TypeCollection

From UIRenderers.cs:1-26:

[TypeCollection(typeof(UIRendererBase), typeof(IUIRenderer), typeof(UIRenderers))]
public partial class UIRenderers : TypeCollectionBase<UIRendererBase, IUIRenderer>
{
}

Access renderers by name or id:

var renderer = UIRenderers.ByName("Spectre");
var renderer = UIRenderers.ById(1);
var allRenderers = UIRenderers.All();

Implementing a Custom Renderer

From UIRendererBase.cs:16-63:

public abstract class UIRendererBase : TypeOptionBase<int, UIRendererBase>, IUIRenderer
{
    protected UIRendererBase(int id, string name) : base(id, name) { }

    public virtual bool SupportsInteractiveMode => false;
    public virtual bool SupportsAnsiColors => false;
    public virtual bool SupportsFocusManagement => false;
    public virtual bool SupportsHotReload => false;

    // Override these methods in your implementation
    public virtual Task<RenderResult> Render(...) { ... }
    public virtual Task<PromptResult<T>> Prompt<T>(...) { ... }
    public virtual Task<PageResult> RenderPage(...) { ... }
}

Renderer Implementations

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.1.0-preview.11 38 1/12/2026
0.1.0-preview.10 37 1/12/2026
0.1.0-preview.9 39 1/9/2026
0.1.0-preview.7 60 1/7/2026