Navigation

Lists

Navigate a bounded vertical list with responsive viewport geometry.

Generated previewCharm
Dedicated Lists example rendered in the Charm skin

The site build compiles the dedicated Ada component example, constructs Lists through its public API, and exports that exact styled surface. Read the capture source.

When to use it

Use a list for simple homogeneous rows. Use a table for columns and a tree for hierarchy.

State and ownership

The Flyology_TUI.Components.Lists package defines this component.

The model retains focus, selected row, top row, and configured dimensions. Content surfaces remain external.

  • The application model owner applies updates during serial event dispatch.
  • Appearance and skin values are borrowed only while the component renders.

Input and updates

Arrows, Page Up, Page Down, Home, End, wheel, and row clicks clamp the visible selection at numeric limits.

Integration sequence

  1. Instantiate the generic with the item type and label function, then create the bounded-size model and set its items.
  2. Pass terminal keyboard or list-local mouse events to Update and read the selected index or item from the model.
  3. Render the list with the current appearance and place the returned surface in the current layout.

See the linked package reference for its exact declarations and contracts.

Responsive and accessible behavior

  • Use dimensions and regions from the current layout or presentation value.
  • When a component owns mouse capture, route its matching release even when the pointer leaves the original bounds.
  • Retain a glyph, label, border, or text-attribute cue when the terminal reduces color.