Josh McKinney 96d097ef76
feat: implement Rect ops for moving (#1596)
feat: implement Rect ops for moving

Implemented `Add`, `AddAssign`, `Sub`, and `SubAssign` on `Rect` for
`Offset`. This makes it possible to move rects

```rust
let rect = Rect::new(1, 2, 3, 4);
let moved = rect + Offset(1, 2);
let moved = rect - Offset(1, 2);
let moved = rect + Offset(-1, -2);
```

Additionally Rect, Size, Offset, and Position now all have MIN and MAX
consts.
2025-11-30 11:57:08 -08:00
..

Widget Examples

This folder contains minimal examples for Ratatui widgets. There are meant to provide code snippets that can be copy-pasted into your application.

Tip

There are also application examples in the top-level examples folder.

You can run these examples using:

cargo run -p ratatui-widgets --example example-name

Note

This folder might use unreleased code. Consider viewing the examples in the latest branch instead of the main branch for code which is guaranteed to work with the released Ratatui version.

Barchart (grouped)

Barchart (grouped)

Barchart

Barchart

Block

Block

Calendar

Calendar

Canvas

Canvas

Chart

Chart

Collapsed Borders

Collapsed Borders

Gauge

Gauge

Line Gauge

Line Gauge

List

List

Logo

Paragraph

Paragraph

Scrollbar

Scrollbar

Sparkline

Sparkline

Table

Table

Tabs

Tabs