package toffee

All checked builds pass
  1. Overview
  2. Docs
CSS layout engine for OCaml (Flexbox, Grid, Block)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mosaic-0.2.0.tbz
sha256=ab48bc02082f9c1deea0769a13c2935df529536630745ec3a3d718f59656109b
sha512=c0f3c490e13ca60217d9d59c9bfdf3ada12e1565f04fe2a623e7c94298d519393eabe404e2317726712bf5e7fa860780a07494e77994ac05032e71f535c56910

doc/README.html

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.