Macro ratatui::border

source ·
macro_rules! border {
    ( $($b:tt), +) => { ... };
    () => { ... };
}
Available on crate feature macros only.
Expand description

Macro that constructs and returns a Borders object from TOP, BOTTOM, LEFT, RIGHT, NONE, and ALL. Internally it creates an empty Borders object and then inserts each bit flag specified into it using Borders::insert().

§Examples

 use ratatui::{border, prelude::*, widgets::*};

 Block::default()
     //Construct a `Borders` object and use it in place
     .borders(border!(TOP, BOTTOM));

 //`border!` can be called with any order of individual sides
 let bottom_first = border!(BOTTOM, LEFT, TOP);
 //with the ALL keyword which works as expected
 let all = border!(ALL);
 //or with nothing to return a `Borders::NONE' bitflag.
 let none = border!(NONE);