Skip to main content

Crate zellij_mason

Crate zellij_mason 

Source
Expand description

Layout and rendering helpers for built-in zellij plugin widgets

§Quickstart

Add zellij-mason and the appropriate version of zellij-tile to your dependencies.

cargo add zellij-tile@0.43.1 zellij-mason

Then use one of the provided components in conjunction with the widgets provided by zellij-tile.

use zellij_mason::{
    Rect,
    table::{self, TableState},
};
use zellij_tile::prelude::*;

#[derive(Default)]
pub struct MyPlugin;

impl ZellijPlugin for MyPlugin {
    fn render(&mut self, rows: usize, cols: usize) {
        let mut table_state = TableState::default();
        table::render(
            ["ID", "Name"],
            &[[Text::new("0"), Text::new("Robert")]],
            Rect {
                x: 0,
                y: 0,
                width: cols,
                height: rows,
            },
            &mut table_state,
        );
    }
}

Re-exports§

pub use geom::*;

Modules§

geom
Geometry types used for layout and rendering
list
A multi-level, nested list of text elements.
tab
List of ribbons used as a tab line.
table
Wrapper around zellij’s table widget with state management.