Tuviv
Tuviv is a library for building terminal user interfaces (TUIs) with
rust with a heavy focus on layout. Tuviv does not come with as many
widgets as, say, tui-rs, but rather
contains many more widgets based on layout: specifically a
Flexbox,
and a Grid,
along with others.
The purpose of this library is to significantly ease creating layouts, which is mildly clunky with tui-rs: such as the fact that you cannot center text vertically (#396) - but also wider-scale things - such as the lack of a flexbox or a grid.
Features
crossterm,termion- different backends.crosstermis enabled by default and is strongly recommended.textwrap- allows for theParagraphwidget. Is enabled by default. (please note if you don't include this you will have to reimplement something to render text)
Examples
Create a Buffer And Render a Widget
// Imports
use io;
use Duration;
use ;
Create More Complicated Widget Trees
Tuviv uses a builder pattern so complicated widgets can be created easily:
use *;
// Create a grid with progressbars:
//
// ╭───────────────╮
// │CPU █▌────────│
// │MEM ███▌──────│
// │GPU ─────CO o │
// ╰───────────────╯
let grid = new
.template_rows
.template_columns
.column_gap
.auto_child
.auto_child
.auto_child
.auto_child
.auto_child
.auto_child
.to_box_sizing
.border
.centered;