Skip to main content
io.display.table() shows records as a table in a page or in a step of an action. It only displays and returns nothing. Provided by the @awaitio/display-table package.
An All users table with linked names, emails, accounts, dates and a … menu at the end of every row

Install

Setup

Register it under the key you want in io, see Display components:
app.ts

Usage

The label is the heading above the table; pass null for none. row has the type of the records in data, so a typo in accessorKey or in row.account.name is a type error.

Props

The records stay on the server: the browser gets only the finished cells and menus. Filtering and paging happen in the browser, on the rows the page sent, so send the rows people need, not the whole table.

Columns

A column is written as in Interval:
  • 'email': the record’s email, headed email.
  • { label: 'Email', accessorKey: 'email' }: the same with your own heading.
  • { label: 'Account', renderCell: (row) => row.account.name }: anything built from the whole record.
renderCell runs on the server, once per row. It returns a plain value or a cell object: They can be combined, e.g. a colored label that links to an action:
A Stores table with Online and Offline badges in green and red, an Open link to each website and the plan as a link
  • highlightColor is one of red, orange, yellow, green, blue, purple, pink and gray.
  • A route can open a page too, such as an unlisted detail of the record: { label: coupon.code, route: couponDetailPage.route({ params: { id: coupon.id } }) }.
  • The filter searches the label. With both url and route, the url wins.
  • A renderCell that throws, an unknown color or a url that is not a full address fails like any other props that do not fit: the page shows an error, and an action fails at that step.

Row menu

rowMenuItems gets each record and returns the links of its … menu, routes from action.route() or page.route(): the same routes ctx.redirect() takes, labelled with the action’s or page’s name unless you pass one. An empty array leaves the row without a menu:
A page’s route goes in the same list and opens the page in the same tab, e.g. the detail of the record next to the actions that change it:
It runs on the server, once per row, like renderCell; a function that throws or returns something that is not a link fails the same way.

How values look

Dates read like Oct 16, 2026, 9:30 AM (a Date from the database arrives as an ISO string and is formatted too), numbers get thousands separators, true and false read Yes and No, an empty value N/A, a cell object its label and any other object its JSON.