Thuja.Tutu 0.0.7

dotnet add package Thuja.Tutu --version 0.0.7
                    
NuGet\Install-Package Thuja.Tutu -Version 0.0.7
                    
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.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Thuja.Tutu" Version="0.0.7" />
                    
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.7
                    
#r "nuget: Thuja.Tutu, 0.0.7"
                    
#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.7
                    
#: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.7
                    
Install as a Cake Addin
#tool nuget:?package=Thuja.Tutu&version=0.0.7
                    
Install as a Cake Tool

Thuja

NuGet version

<p align="center"> <img width="200px" src="src/Thuja/icon.png" alt="icon"/> </p>

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.

Prerequisites

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

Usage

See the examples directory.

// model
let selected = 0

// view
let view selected =
  columns [ Fraction 40; Fraction 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

example

Documentation

See the Wiki for full documentation, details and other information.

Todo (future features list)

  • improve documentation;
  • make comprehensive user input handling:
    • extend keyboard input;
    • mouse input?
  • implement configurable subscriptions;
  • add different control elements:
    • markup;
    • text input?;
    • buttons?;
    • ...
  • handle terminal resizing;
  • add tests;
  • add debug options;
  • ...
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