Thuja.Tutu 0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Thuja.Tutu --version 0.0.1
                    
NuGet\Install-Package Thuja.Tutu -Version 0.0.1
                    
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="Thuja.Tutu" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Thuja.Tutu" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Thuja.Tutu" />
                    
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 Thuja.Tutu --version 0.0.1
                    
#r "nuget: Thuja.Tutu, 0.0.1"
                    
#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 Thuja.Tutu@0.0.1
                    
#: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=Thuja.Tutu&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Thuja.Tutu&version=0.0.1
                    
Install as a Cake Tool

Thuja

Thuja (pronounce: /ˈθuː.jə/) is a minimalistic F# library to build terminal user interfaces. It's inspired by Elm and based on Tutu as a cross-term backend implementation.

NB: Really raw version with a bunch of work to do.

Prerequisites

  • .NET SDK to work with F# files and dependencies.

Usage

See the examples directory.

// model
let selected = 0

// view
let view selected =
  columns [ 40; 60 ] [
    panel [ 
      list [
        "The quick brown fox jumps over the lazy dog"
        "съешь же ещё этих мягких французских булок, да выпей чаю"
        "exploited by the real owners of this enterprise, for it is they who take advantage of the needs of the poor" 
      ] selected
    ]
    panel [
      text "Use '↑' and '↓' keys to navigate through the list items, 'Ctrl+C' for exit."
    ]
  ]

// update
let update selected event  =
  let length = 2
  match event with
  | Char 'c', KeyModifiers.Ctrl -> selected, Program.exit()
  | Down, _ -> Math.Min(length, selected + 1), Cmd.none
  | Up, _ -> Math.Max(0, selected - 1), Cmd.none
  | _ -> selected, Cmd.none

// program
Program.make selected view update
|> Program.withKeyBindings Cmd.ofMsg
|> Program.withTutuBackend
|> Program.run

Todo

  • implement not implemented parts (see todo in a code);
  • make comprehensive user input handling:
    • keyboard input (different keys, key kinds?, modifiers, etc);
    • mouse input?
  • decide if to use dispatch in view and self-sufficient reactive elements or process elements state through the model;
  • add different control elements:
    • text input;
    • button;
    • implement panel borders style (see todo in a code);
    • ...
  • add different layout options (exact sizing, padding/margin, etc)?;
  • handle terminal resizing;
  • add styles;
  • add tests;
  • add debug options;
  • make nuget package;
  • write documentation;
  • consider using elmish as MVU framework?;
  • ...
Product 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. 
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.0.7 134 7/9/2025
0.0.6 148 6/18/2025
0.0.5 294 6/12/2025
0.0.4 117 6/7/2025
0.0.3 89 6/6/2025
0.0.2 143 6/5/2025
0.0.1 143 6/3/2025