Table
Compares information in aligned rows and columns.
Preview
Local preview. It doesn't affect real accounts, environments, or run data.
Compare the same example at each size, density and table style. Switching keeps input values and selection state. Size guidance and comparisons
0 selected.
Usage
Compare relationships across rows and columns. Render a native table: Caption, HeaderCell with scope=col or scope=row, and Cell. Wrap it in Container, the labeled scroll region. Set numeric on number columns, use SortHeader for sortable columns, and set density="compact" for consoles people scan with a pointer. The calling screen owns sorting, search, and selection state; useTableSelection keeps selection by row ID. See Guidelines below for each rule with a working design. Set layout="fixed" with Column widths so columns hold still while rows change, nowrap for a console's one-line rows with Truncate for long names, and hideBelow on a column that can step aside when the Container narrows.
- Don't add a grid role or arrow-key cell navigation to an ordinary table. Keep native table semantics instead.
- Don't rely on whole-row clicks. Put links, buttons, and checkboxes in the cells instead.
- Don't rely on Row.selected alone, because it's visual only. Pair it with a named checkbox, which carries the selection semantics.
- Don't put units in every cell. Name the unit in the header and set numeric instead.
Size: SizeProvider size="small" resizes the whole composition, including portals. The default size is Default. Size guidance and comparisons
Anatomy
Container(ScrollArea) → Root(table, density, layout, stickyHeader) → Caption + Columns(Column)? + Head(Row/HeaderCell or SortHeader) + Body(Row/Cell, Truncate, or Message)
Guidelines
Rules for real screens, each with a working design. The designs use the shipped parts and stay local.
These rules cover tables in platform consoles: service inventories, usage, deployments and audit entries. Every preview uses the Table parts as they ship.
Choose a table
- Use Table to compare the same attributes across many records, such as services, deployments or audit entries.
- Use List when each record reads on its own and has three attributes or fewer.
- Use a description list for the attributes of one record.
- Don't edit cells in place. Link each row to its detail page, or open a form in a dialog instead.
Density
- Use the default density for rows that mix text, controls and status, and on touch screens.
- Use density="compact" in consoles where people scan dozens of rows with a pointer. Cells drop to 4px padding, with 2px between rows.
- Use small controls in compact rows, so every row keeps the same height.
Alignment and numbers
- Align text, status and links to the start.
- Set numeric on number columns and their headers. They align to the end with tabular figures, so digits line up.
- Put the unit in the header, such as Memory (GiB), and keep it out of the cells.
- Use one number of decimals per column, and format numbers in the reader's locale.
- Center only a column of single icons or checkboxes.
Sorting
- Make a column sortable when its order helps a decision: names, dates, numbers and severity.
- Use SortHeader. Every sortable column shows its icon, and only the sorted column carries aria-sort.
- Sort text ascending first, and numbers and dates descending first, so the largest or newest comes up. A second press reverses the order.
- Break ties by a stable ID, so equal rows keep their order.
- Announce the new order in a polite status line.
Sorted by p95 latency (ms), descending.
Long values
- Let names and prose wrap.
- Truncate identifiers, image references and paths with Truncate. The full value stays in the accessible name and the title.
- Give a truncated identifier a copy action, so people never retype it.
- Don't truncate numbers or status. Shorten the unit or drop a column instead.
Selection and bulk actions
- Put the checkbox first, and name it after its row: "Select checkout-api".
- The header checkbox selects the selectable rows on this page only. It shows a dash when some of them are selected.
- Keep selection by ID across pages, sorting and filters, and say how many selected rows are on other pages.
- Show bulk actions with the count. Disable them while nothing is selected.
- Disable rows people can't change, and say why in the row.
Row actions
- Make the name the row's link to its detail page. Don't make the whole row clickable.
- Show at most one action in the row. Put the rest in a menu named after the row: "Actions for checkout-api".
- Align the actions column to the end.
- Confirm a destructive action, and name its target in the confirmation.
Loading, empty and errors
- Keep the header and column widths while loading. Show skeleton rows for the page size, and set aria-busy on the table.
- Tell no results apart from no data. Offer Clear filters for one and a create action for the other.
- Show an error in place with a retry, and keep filters and selection.
- Put each message in Message, so it spans every column and doesn't highlight on hover.
Scrolling
- Let the page scroll by default.
- Bound the height only when other content must stay in view beside the table. Then set stickyHeader, and give the Container orientation="both".
- Name the scroll region with the Container's label.
- On narrow screens the table scrolls sideways inside its region. Keep the name column first, and set stickyColumn when rows are wider than the screen.
- Group columns under a header row of their own: a group cell spans its columns with colSpan, and a column outside the groups spans both rows with rowSpan. A sticky header keeps both rows, each where it sits.
Keyboard and accessibility
Tab moves through sort buttons, row selection checkboxes, and actions. Rows aren't focus targets. On small screens, the labeled region takes focus and scrolls horizontally. SortHeader sets aria-sort on the sorted column only, and its button keeps the column's visible name.
Give each control a name that describes its purpose. Connect error messages to their controls, and signal state with more than color. Automated checks don't replace manual keyboard and assistive technology testing.
Example code
Shared components take their styles from design tokens. Each example sets its own composition and accessibility attributes. The calling screen defines callbacks, refs, and product data.
Key API
The table lists the common wrapper's main props. See the package type declarations for the full types.