FractalDataWorks.UI.Components 0.1.0-preview.28

This is a prerelease version of FractalDataWorks.UI.Components.
dotnet add package FractalDataWorks.UI.Components --version 0.1.0-preview.28
                    
NuGet\Install-Package FractalDataWorks.UI.Components -Version 0.1.0-preview.28
                    
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.UI.Components" Version="0.1.0-preview.28" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FractalDataWorks.UI.Components" Version="0.1.0-preview.28" />
                    
Directory.Packages.props
<PackageReference Include="FractalDataWorks.UI.Components" />
                    
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.UI.Components --version 0.1.0-preview.28
                    
#r "nuget: FractalDataWorks.UI.Components, 0.1.0-preview.28"
                    
#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.UI.Components@0.1.0-preview.28
                    
#: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.UI.Components&version=0.1.0-preview.28&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=FractalDataWorks.UI.Components&version=0.1.0-preview.28&prerelease
                    
Install as a Cake Tool

FractalDataWorks.UI.Components

Backend-agnostic UI data models for configuration forms.

Overview

This package provides concrete component model implementations including TextInput, Select, MultiSelect, Numeric, DatePicker, Checkbox, and Page models. These models are framework-independent and can be rendered by Spectre.Console, RazorConsole, Blazor, or other UI backends.

Installation

dotnet add package FractalDataWorks.UI.Components

Component Models

This package provides data models that implement the interfaces from FractalDataWorks.UI.Abstractions.

TextInputModel

From TextInputModel.cs:9-59:

public sealed class TextInputModel : IInputComponentModel<string>
{
    public string Id { get; set; } = "";
    public string? Label { get; set; }
    public string? HelpText { get; set; }
    public string? Placeholder { get; set; }
    public bool IsRequired { get; set; }
    public bool IsReadOnly { get; set; }
    public bool IsVisible { get; set; } = true;
    public int Order { get; set; }
    public string? Value { get; set; }
    public string? DefaultValue { get; set; }
    public int? MaxLength { get; set; }
    public int? MinLength { get; set; }
    public string? Pattern { get; set; }
    public bool IsPassword { get; set; }
    public bool IsMultiline { get; set; }
    public Type ValueType => typeof(string);
}

PageModel

From PageModel.cs:13-72:

public sealed class PageModel : IPageModel
{
    private readonly List<SectionModel> _sections = [];

    public string Id { get; set; } = "";
    public string Title { get; set; } = "";
    public string? Description { get; set; }
    public IReadOnlyList<ISectionModel> Sections => _sections.AsReadOnly();
    public IPageMode Mode { get; set; } = PageModes.View;
    public bool HasChanges { get; set; }

    public void AddSection(SectionModel section)
    {
        _sections.Add(section);
    }

    public ValidationResult Validate()
    {
        var results = _sections
            .SelectMany(s => s.AllComponents)
            .Select(c => c.Validate())
            .ToList();

        return ValidationResult.Combine(results.ToArray());
    }
}

SectionModel Factory Methods

From PageModel.cs:132-166:

// Single column section
var section = SectionModel.SingleColumn("basics", "Basic Information",
    new TextInputModel { Id = "name", Label = "Name", IsRequired = true },
    new TextInputModel { Id = "description", Label = "Description" });

// Two column section
var twoColSection = SectionModel.TwoColumns(
    "details",
    "Details",
    leftComponents: new IComponentModel[] { /* left column */ },
    rightComponents: new IComponentModel[] { /* right column */ });

Validation

Component models implement validation via ValidationResult. From TextInputModel.cs:91-129:

public ValidationResult Validate()
{
    if (IsRequired && string.IsNullOrWhiteSpace(Value))
    {
        return ValidationResult.Error($"{Label ?? Id} is required.");
    }

    if (MinLength.HasValue && Value?.Length < MinLength.Value)
    {
        return ValidationResult.Error($"{Label ?? Id} must be at least {MinLength.Value} characters.");
    }

    if (MaxLength.HasValue && Value?.Length > MaxLength.Value)
    {
        return ValidationResult.Error($"{Label ?? Id} must not exceed {MaxLength.Value} characters.");
    }

    if (CustomValidator != null)
    {
        return CustomValidator(Value);
    }

    return ValidationResult.Success();
}

Key Types

IRenderMode (TypeCollection)

Render modes are defined as a TypeCollection in FractalDataWorks.UI.Abstractions. From IRenderMode.cs:9-20:

public interface IRenderMode : ITypeOption<int, RenderModeBase>
{
    bool AllowsEditing { get; }
    bool ShowsView { get; }
}

Available modes (from TypeOptions in the Abstractions package):

Mode AllowsEditing ShowsView
View false true
Edit true false
Both true true

Access via TypeCollection lookup: RenderModes.ByName("Edit") or RenderModes.View.

IComponentModel

From IComponentModel.cs:18-63:

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();
}

Dependencies

  • FractalDataWorks.UI.Abstractions - Core interfaces and base classes
  • FractalDataWorks.Collections - TypeCollection support
  • FractalDataWorks.UI.Components.Blazor - Blazor component implementations
  • FractalDataWorks.UI.Components.TUI - Spectre.Console TUI components
  • FractalDataWorks.UI.Components.RazorConsole - Razor-based console rendering
  • FractalDataWorks.UI.Rendering.Spectre - Spectre page renderers
  • FractalDataWorks.UI.DependencyInjection - Service registration

Next Steps

  • See FractalDataWorks.UI.Abstractions for base classes and interfaces
  • See FractalDataWorks.UI.Rendering.Spectre for console rendering
  • See FractalDataWorks.UI.Components.Blazor for web rendering
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on FractalDataWorks.UI.Components:

Package Downloads
FractalDataWorks.UI.Rendering.Spectre

Development tools and utilities for the FractalDataWorks ecosystem. Build:

FractalDataWorks.TUI.Management

Development tools and utilities for the FractalDataWorks ecosystem. Build:

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.28 0 1/15/2026
0.1.0-preview.24 0 1/15/2026
0.1.0-preview.15 25 1/15/2026
0.1.0-preview.11 41 1/12/2026
0.1.0-preview.10 38 1/12/2026
0.1.0-preview.9 48 1/9/2026
0.1.0-preview.7 61 1/7/2026