pito-header

pito-header is the top of a PITO MD terminal app, as a small ratatui 0.30 crate: groups of numbered sections in two nested rows, drill-in with a breadcrumb, and optional title, facts and notice rows, all abbreviating to fit the width. It has no app logic and no words of its own: the app passes in every name, every style and every key.
It works on Linux, Windows and macOS, and CI tests it on all three.
At a glance
Section titled “At a glance”| Full header, drawn at 150 columns | 8.7 µs a frame (mean of 200,000) |
| Nav rows alone / a click hit-test | 2.1 µs / 0.11 µs |
| Allocations while drawing or hit-testing | 0 (a counting allocator in the tests holds it) |
| Dependencies | 3: ratatui, unicode-segmentation, unicode-width; no terminal backend unless you turn on crossterm |
| Size | about 1,540 lines of Rust, 75 tests |
Measured on 2026-10-14 on an AMD Ryzen 9 9950X with Rust 1.97.1, with
cargo run --release --example bench 200000. Measure draw time
shows how to run it on your machine.
Where to start
Section titled “Where to start”- Install: add the crate and draw a first header.
- Groups and numbered sections: build the nav.
- Map keys to moves: choose which keys move it.
- Fit any width: how the rows abbreviate.
- Drill in with a breadcrumb: go deeper and come back.
- Add title, facts and notice rows: the optional rows.
- Style a section in several colours: spans and live labels.
- Handle clicks: turn a mouse click into a move.
- Measure draw time: run the bench.
- API at a glance, and the full API reference.
Part of PITO MD
Section titled “Part of PITO MD”pito-header is one of the ratatui crates behind PITO MD’s terminal apps, with pito-footer, pito-list, pito-hourglass and pito-tui, the shell that brings them together.
The code is MIT licensed, by Catalin Ilinca. The PITO MD name and its logos are © Catalin Ilinca, all rights reserved, and not covered by the MIT licence.