Skip to Content
ExamplesTable Interaction

Table Interaction

This example demonstrates:

  • Table
  • row selection
  • keyboard navigation
  • summary updates
The selection flow inside Table Interaction
1Up / Down changes the selected row
2runtime routing hands the key to Table
3the selected row enters state
4the summary derives from that row
5runtime redraws only the regions that changed

Run:

cargo run -p ansiq-examples --example table_interaction
Terminal shot of Table Interaction

The real table_interaction example running in a terminal.

Widgets to study alongside this example

What this example is good for

Read this after List Navigation. It pushes the same core selection model into a more structured data shape:

  • multiple columns instead of one label
  • explicit row selection instead of a simple current item
  • a summary panel derived from the selected row

How to read the code

A good order is:

  1. the row data
  2. how the current row is stored
  3. how the summary derives from that row
  4. only then the exact Table props
  1. Table
  2. Widget Patterns
  3. State, Focus, Input
  4. Layout and Rendering
Last updated on