17 releases (5 breaking)

new 0.15.5 Jun 15, 2024
0.15.4 Jun 9, 2024
0.14.0 May 30, 2024
0.13.1 May 29, 2024
0.10.0 May 13, 2024

#289 in Command-line interface

Download history 170/week @ 2024-05-10 674/week @ 2024-05-17 333/week @ 2024-05-24 515/week @ 2024-05-31 206/week @ 2024-06-07

1,812 downloads per month
Used in 3 crates (via rat-widget)

MIT/Apache

1MB
3K SLoC

crates.io Documentation License License

Table widget based on ratatui.

Could be used as a drop-in replacement for the ratatui table. But that's not the point of this widget.

This widget uses the TableData trait instead of rendering all the table-cells and putting them into a Vec. This way rendering time only depends on the screen-size not on the size of your data.

There is a variant that takes an Iterator of TableRowData. It has as few traps though. If the Iterator doesn't have an efficient skip() or if you can't give the number of rows this will iterate all your data for the necessary information. This might slow down everything a bit.

image

More bullet points:

  • Row and Column offset for rendering.
  • Pluggable selection with TableSelection
    • Allows row/column/cell selection.
    • Row/column/cell selection + Header/Footer selection each with its own style.
  • Basic key/mouse handling present.

Eventhandling is currently crossterm only. In practice event-handling is calling 1 or 2 functions on the state, so this should be easy to map to other systems. (Contributions welcome :)

Dependencies

~6–12MB
~119K SLoC