Skip to content

Table

alikit:table is a static, composable, non-spanned presentation table for read-oriented data. It owns intrinsic row heights, wrapped cell text, inline icon/detail formatting, headers, and optional fixed-row virtualization. It owns no managed focus, selection, roving navigation, or activation. Column tracks, header parts, and cell semantic scaffolding are shared with Data Grid through alikit:table_core.

Native static table window with a documents table, header row, and two-line cells
Native SDL_GPU capture of examples/table at Alicorn 47c9d4a. The application owns the rows and formatting; the table renders the static projection and optional virtual window.
Interactive WebGPU preview is a later catalog step. The capture is the real native table.
LayerResponsibility
AlicornLayout, text shaping, table collections/roles, virtual list, theme roles, pointer/focus primitives.
table_coreShared Column/Cell/Row/Alignment shapes, column tracks, header parts, cell semantic scaffolding, and surface fallback.
tableStatic body composition, intrinsic row measurement, wrapped cells, optional virtualization, theme contract.
ApplicationColumns, rows, stable keys, sorting/filtering, formatting, data lifetime, document navigation policy.

The component keeps no state and allocates nothing. It borrows columns and rows for the call.

Files: table/table.odin, table/table_test.odin, examples/table/main.odin, examples/table/theme.json.

import table "alikit:table"
table.table(
ctx,
app.columns[:],
app.projection[:app.visible_count],
table.Options{
accessible_label="Documents",
row_header=true,
alternate_rows=true,
max_visible_rows=10,
measure_width=680,
},
key=alicorn.key_string("documents"),
instance_id=1,
recipe=app.table_recipe,
)

No init or destroy is required. Validate optional theme roles once with theme_contract_default, theme_contract_check, and theme_contract_missing_required.

PartIdentityWhat can be omitted or replaced
Tabletable_semantic_id(instance_id)Always present; the Table collection.
Header rowheader_row_semantic_id(instance_id)Omit with Options.hide_header; logical row 0 when present.
Header cellheader_cell_semantic_id(instance_id, column_key)Table_Column_Header, drawn by the shared header parts.
Body rowrow_semantic_id(instance_id, row_key)Nested Table_Row collection.
Body cellcell_semantic_id(instance_id, row_key, column_key)Table_Cell, or Table_Row_Header for the first column.

Column keys and row keys must be nonzero and unique. A body row at application index i is logical position i+1 when a header exists. MAX_COLUMNS is 64; spans are not implemented. Column, Cell, Row, and Alignment are aliases of alikit:table_core shapes; the shared Column also carries optional sortable/sort fields, which Table ignores.

Recipe declares three optional namespaced surface roles:

FieldCore fallback
header_surface_roleSubtle_Surface
row_surface_roleSurface
alternate_row_surface_roleSubtle_Surface

Zero roles need no registration. Configured roles are validated with the theme_contract_* helpers; an unresolved configured role falls back to the core role at render time.

Style carries the header corner radius and divider width. Options carries header height, cell padding, column gap, text sizes, wrapping, alternating rows, and optional virtualization. There is no animation; layout is immediate.

Intrinsic rows. When Options.no_wrap is false (the default), the component measures primary and detail text at the column’s resolved width and authors the row height so wrapped text and secondary lines are not clipped. Fixed columns use their declared width; flexible columns use the equal share of Options.measure_width. Set measure_width to the intended container width.

Virtualization is opt-in (Options.virtualize with max_visible_rows and virtual_row_height). Unrealized rows are published as virtual Table_Row semantic items.

  • The table is one ordinary focusable container. There is no cell navigation, no roving focus, and no Tab stop per cell.
  • Arrow keys are not consumed by this component. Wrap the table in alikit:scroll_area when the region should own keyboard scrolling.
  • Header cells publish Table_Column_Header; the first body column publishes Table_Row_Header when row_header is set; other cells publish Table_Cell.
  • The collection publishes its accessible name, logical count (header + rows), and realized window.
  • Not claimed: sorting controls, selection, activation, editing, spans, column resizing/reordering, or built-in filtering. Use Data Grid for the interactive dataset path.

table/table_test.odin covers:

  • stable table/row/cell identities and shared column-track mapping;
  • the theme contract and missing-role diagnostics;
  • Table logical count, header positions, row/cell roles, and absence of selected/current state;
  • intrinsic row growth for a wrapped cell with a detail line;
  • optional fixed-row virtualization and wheel reveal of the last logical row;
  • the native example smoke path.
Terminal window
odin test table -define:ODIN_TEST_THREADS=1 -collection:alicorn=<alicorn> -collection:alikit=.
./out/table_example.exe --smoke

There is no testui static-table pattern at the pinned revision; explicit drive assertions cover the contract.

DeclarationNotes
Alignment, Column, Cell, RowAliases of alikit:table_core shapes.
OptionsAccessible/empty labels, header visibility, row header, geometry, text sizes, wrapping, alternation, virtualization, measure width.
Recipe / StyleOptional namespaced surface roles and visual geometry.
tableDescribe the static table.
recipe_default, style_defaultCore-role defaults.
theme_contract_default, theme_contract_check, theme_contract_satisfied, theme_contract_missing_requiredSetup-time validation.
table_semantic_id, header_row_semantic_id, header_cell_semantic_id, row_semantic_id, cell_semantic_idStable semantic identities.
  • Headless tests do not prove a physical screen-reader table session, pixels, or native table navigation commands.
  • Wrapped flexible columns are measured against Options.measure_width; a very different final width can make the authored intrinsic height conservative.
  • Non-spanned only. Virtualized rows do not publish their cells until realized.
  • Sorting and filtering remain application callbacks over the caller’s projection.
Pin: built and captured against Alicorn 47c9d4a7cd1f637876190fec899daeeac00a30ae. See Compatibility and pinning.