Skip to main content

Crate ratatui_table

Crate ratatui_table 

Source
Expand description

An experimental evolution of Ratatui’s built-in Table widget.

ratatui-table starts with the Table implementation from Ratatui main at 3d8639c. Version 0.1.0 is intended to render like that built-in Table while giving Table contributors room to explore borders, virtualization, selection, marking, borrowed data, and other changes independently.

This crate is an opt-in development path for the built-in widget, not a competing Table design. If the experiment succeeds, Ratatui should be able to offer an easy upgrade or re-export path. No such re-export is implemented or promised yet.

§Stability

Releases before 1.0 may make breaking changes in minor versions. Each breaking release should document how to migrate. The 0.1.0 baseline deliberately avoids folding the existing Table proposals into the initial extraction so each proposal remains independently reviewable.

§Installation

cargo add ratatui-table

§Example

use ratatui::layout::Constraint;
use ratatui_table::{Row, Table};

let rows = [
    Row::new(["Alice", "Engineer"]),
    Row::new(["Bob", "Designer"]),
];
let widths = [Constraint::Length(10), Constraint::Length(12)];
let table = Table::new(rows, widths);

§Ratatui compatibility

Table::block accepts a ratatui-widgets Block to preserve the built-in API. This means the initial crate depends on ratatui-widgets with default features disabled. A future Ratatui facade can re-export this crate without requiring this crate to become part of ratatui-widgets itself.

§Feature flags

  • std enables the standard-library features of the Ratatui dependencies. The Table itself remains usable with no_std plus alloc by default.
  • serde adds serialization and deserialization for TableState, HighlightSpacing, and HighlightPlacement.

§Governance

Contributors with repository Write access can review and merge ordinary Table work. Ratatui maintainers retain control of protected release configuration and approve every crates.io publication.

Structs§

Cell
A Cell contains the Text to be displayed in a Row of a Table.
Row
A single row of data to be displayed in a Table widget.
Table
A widget to display data in formatted columns.
TableState
State of a Table widget

Enums§

HighlightPlacement
Where the highlight symbol gets space, i.e. which columns are indented to make room for it.
HighlightSpacing
This option allows the user to configure the “highlight symbol” column width spacing