Skip to content

Commit

Permalink
docs: Update README with better examples 📚
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Jan 9, 2024
1 parent b7f8ec0 commit 31a2c45
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ Create vertical and horizontal layouts using the `vertical!` and `horizontal!` m

```rust
use ratatui_macros::{vertical, horizontal};
let vertical_layout = vertical![==50, ==30%];
let horizontal_layout = horizontal![==1/3, >=100, <=4];
use ratatui::prelude::Rect;
let area = Rect { x: 0, y: 0, width: 10, height: 10 };

let vertical_layout = vertical![==100%, >=3];
let [main, bottom] = vertical_layout.split(area).to_vec().try_into().unwrap();

let horizontal_layout = horizontal![==10, ==100%, ==10];
let [left, main, right] = horizontal_layout.split(area).to_vec().try_into().unwrap();
```

## Contributing
Expand Down

0 comments on commit 31a2c45

Please sign in to comment.