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.
Preview
Section titled “Preview”
Responsibility split
Section titled “Responsibility split”| Layer | Responsibility |
|---|---|
| Alicorn | Layout, text shaping, table collections/roles, virtual list, theme roles, pointer/focus primitives. |
table_core | Shared Column/Cell/Row/Alignment shapes, column tracks, header parts, cell semantic scaffolding, and surface fallback. |
table | Static body composition, intrinsic row measurement, wrapped cells, optional virtualization, theme contract. |
| Application | Columns, 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.
Copyable implementation
Section titled “Copyable implementation”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.
Parts and identities
Section titled “Parts and identities”| Part | Identity | What can be omitted or replaced |
|---|---|---|
| Table | table_semantic_id(instance_id) | Always present; the Table collection. |
| Header row | header_row_semantic_id(instance_id) | Omit with Options.hide_header; logical row 0 when present. |
| Header cell | header_cell_semantic_id(instance_id, column_key) | Table_Column_Header, drawn by the shared header parts. |
| Body row | row_semantic_id(instance_id, row_key) | Nested Table_Row collection. |
| Body cell | cell_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.
Styling, motion, and theme
Section titled “Styling, motion, and theme”Recipe declares three optional namespaced surface roles:
| Field | Core fallback |
|---|---|
header_surface_role | Subtle_Surface |
row_surface_role | Surface |
alternate_row_surface_role | Subtle_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.
Keyboard and accessibility contract
Section titled “Keyboard and accessibility contract”- 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_areawhen the region should own keyboard scrolling. - Header cells publish
Table_Column_Header; the first body column publishesTable_Row_Headerwhenrow_headeris set; other cells publishTable_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.
Conformance tests
Section titled “Conformance tests”table/table_test.odin covers:
- stable table/row/cell identities and shared column-track mapping;
- the theme contract and missing-role diagnostics;
Tablelogical 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.
odin test table -define:ODIN_TEST_THREADS=1 -collection:alicorn=<alicorn> -collection:alikit=../out/table_example.exe --smokeThere is no testui static-table pattern at the pinned revision; explicit drive assertions cover
the contract.
API reference
Section titled “API reference”| Declaration | Notes |
|---|---|
Alignment, Column, Cell, Row | Aliases of alikit:table_core shapes. |
Options | Accessible/empty labels, header visibility, row header, geometry, text sizes, wrapping, alternation, virtualization, measure width. |
Recipe / Style | Optional namespaced surface roles and visual geometry. |
table | Describe the static table. |
recipe_default, style_default | Core-role defaults. |
theme_contract_default, theme_contract_check, theme_contract_satisfied, theme_contract_missing_required | Setup-time validation. |
table_semantic_id, header_row_semantic_id, header_cell_semantic_id, row_semantic_id, cell_semantic_id | Stable semantic identities. |
Limits
Section titled “Limits”- 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.
Compatibility
Section titled “Compatibility”47c9d4a7cd1f637876190fec899daeeac00a30ae. See
Compatibility and pinning.