package mosaic

Build not yet checked
  1. Overview
  2. Docs
Terminal UI framework for OCaml with The Elm Architecture

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.3.0.tbz
sha256=a92cbbcbe016fb19fb0a749222da0e459a9567aef3f4c7340d9bd6b71c53ed6f
sha512=6a7ab054605538bb31a2b73a1a6d093981a2704c9f0af5852221c05735290d74aca7c7282298c4d0f91e86a800e2ccd94b4918af883cd963449c758eb6b272b3

Description

Mosaic is a terminal UI framework implementing The Elm Architecture: state is a typed model, the UI is a pure function of the model, and side effects are explicit values. It provides composable widgets (text, input, select, table, tree, markdown, canvas, and more), CSS Flexbox and Grid layout via Toffee, and efficient rendering via Matrix.

Tags

tui terminal tea elm user-interface

Added to opam-repository:

README

Mosaic

Terminal user interfaces for OCaml.

This repository contains three packages that work together or independently:

Package

Description

Mosaic

High-level UI framework with The Elm Architecture

Matrix

Terminal toolkit: rendering, input, PTY, VTE

Toffee

CSS layout engine (Flexbox, Grid, Block) ported from Taffy

Mosaic provides a TEA runtime (model / update / view), built-in widgets, and CSS layout via Toffee. Editors, scrolling, selection, and focus are model values; semantic callbacks return messages that update accepts, transforms, or rejects. Selection follows application values across reordering. ~on_focus_request lets a pointer press propose focus before caret placement; raw event callbacks remain optional-message filters.

Matrix is the terminal layer: double-buffered rendering that diffs cell changes to emit minimal ANSI output, Kitty keyboard, SGR mouse, bracketed paste, focus reporting, and a virtual terminal emulator. Usable on its own for immediate-mode terminal apps.

Toffee is a pure OCaml port of Taffy. It computes Flexbox, Grid, and Block layout with no C stubs and no runtime dependencies.

Syntax highlighting is backend-neutral. See the tree-sitter recipe and the independent Tree-sitter bindings.

Getting started

Each package's README shows how to install it and write a first program, and its examples are listed with their run commands: Mosaic (examples), Matrix (examples), Toffee (examples).

License

ISC. See LICENSE.

Dependencies (5)

  1. cmarkit >= "0.4.0"
  2. toffee = version
  3. matrix = version
  4. dune >= "3.19"
  5. ocaml >= "5.1"

Dev Dependencies (6)

  1. odoc with-doc
  2. lwt with-test
  3. eio_main with-test
  4. thumper with-test & >= "0.1.0"
  5. ppx_windtrap with-test & >= "0.3.1"
  6. windtrap with-test & >= "0.3.1"

Optional Dependencies (2)

  1. lwt
  2. eio

Used by

None

Conflicts (2)

  1. lwt < "5.7.0"
  2. eio < "1.0"

Build status

Results of building mosaic with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

This version is not in the latest run; the versions below are.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2.0 n/a n/a n/a good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure