Skip to main content

Crate ratagrid

Crate ratagrid 

Source
Expand description

A mouse-first data grid for Ratatui.

Render Grid::widget each frame, then pass focused keyboard events and mouse events to Grid::handle_event. Rendering and hit-testing share one layout.

The application owns terminal setup, component focus, fetching, persistence, and animation timing. Owned datasets sort globally; external grids request one source-sorted page at a time.

use ratagrid::{Column, Grid};
let columns = vec![Column::new("Value", 12, |n: &u64| n.to_string())
    .sortable(|a, b| a.cmp(b))];
let mut grid = Grid::new(columns, vec![100, 2, 10]);
// In your draw callback: frame.render_widget(grid.widget(), area);
// In your focused event loop: grid.handle_event(&event);

See the bundled feature guide, pagination guide, and updates guide.

Modules§

guides
Integration guides bundled with the crate, independent of repository access.

Structs§

CellDetail
The complete, printable value currently shown in a detail panel.
CellDetailsOptions
Opt-in full-value panels for truncated data cells.
Column
A typed column. Sorting compares records, independently of their display text.
ColumnOrderError
Invalid column order. Supply each original column index exactly once.
CursorPageRequest
A cursor request. Capture this value and the search query before dispatching asynchronous work; return the original request with its response.
ExternalFilterError
Typed predicates cannot be executed against records held by an external source.
Grid
Interactive grid state plus its framework-independent model.
GridModel
Framework-independent ordering and selection over owned records.
GridStyle
Colors for the grid. Replace these to match your application’s theme.
GridWidget
A widget borrowing the grid, updating its hit-test geometry while rendering.
PageRequest
A page/sort request. Keep this value with an asynchronous request and return it unchanged to crate::Grid::set_page_data to reject stale responses.
PageState
Read-only pagination metadata. Empty datasets have one empty page.
Sort
Single-column sort state. None restores insertion order.

Enums§

Action
Changes emitted by grid interaction. Row indices refer to insertion order.
CopyTarget
What to format for an application-owned clipboard operation.
LoadState
Current display state. Errors belong to the current external request only.
PageError
A page response was not accepted. Failed responses leave the current grid unchanged.
PaginationMode
Who owns the full dataset and performs sorting.
SortDirection
The direction of an active sort.