Entity table
Components: Table, TableActionBar, TableActionBarSelection, TableEmptyState, Badge, Tag, OverflowList, Avatar
+11 more
AvatarContent, AvatarName, AvatarDescription, Code, FormatDateTime, DropdownMenu, DropdownMenuItem, Button, Tooltip, Switch, EmptyState
One Table with a fixed cell vocabulary, a row menu in the master cell and a bulk bar.
When to use
Use only these cells.
Rules
Layout and spacing
- The first column is pinned and never hideable: put the entity name there.
Tableowns its frame, borders, padding and header. Never wrap it in a bordereddivor restyle cells viameta.cellClassName.PageContent,DrawerBodyandDialogBodyown the gutter. Never addp-24or any padding aroundTable.- Set widths with
size: name320, email240, status140, timestamp200(the default minimum is 96px). - If columns must keep their
size, passstretch={false}. - Two-line cell: add a
Text size='xs' color='secondary'line; there is norowHeight.
Row menu
- Every contextual row action goes through the master cell:
meta: { renderMenuAction }on the first column. Its…shows on row hover, while the menu is open and on the previewed row. - Never add a trailing actions column or buttons in cells. There is no
actionscolumn type oralwaysShowMenu. - Trigger:
Button variant='ghost' color='neutral' size='small',Ellipsisicon,aria-labelnaming the row. - Order items: open, edit, reorder, state changes,
DropdownMenuSeparator, destructive. - Use
variant='destructive'and name the entity: "Delete user", not "Delete". Confirm before deleting. - Inherited or read-only row: only view and "Open at {scope}".
Data and selection
- Always pass
getRowId={row => row.id}; selection,activeRowIdand reordering key on it. - For selection, pass
rowSelectionandonRowSelectionChange; without the handler there are no checkboxes. - Sorting:
sortingandonSortingChange, plusmanualSortingif the server sorts. - Bulk actions:
Button variant='ghost' color='neutral-alt'inTableActionBar; destructive last withcolor='destructive'; options go in aDropdownMenu. - Custom selection text:
TableActionBarSelection(from@wallarm-org/design-system/Table) withBulkBarSummaryCount,BulkBarSummarySelectAll,BulkBarSummaryClearas direct children. - Drag to reorder:
onRowReorder; pin rows withgetRowCanDrag.
Values
- Status
color: Active, Enabled, Connectedgreen; Invited, Pending, Needs attentionyellow; Expired, Failed, Errorred; Deactivated, Disabled, Draftgray.Badgehas nostatusprop. - Never show
0for missing data; show'—'.FormatDateTimerenders—fornullitself. - Never set
meta.alignon numbers; they align right on their own. If the first row can benullor'—', setmeta: { sortType: 'number' }. - Header explanation:
meta.description: { type: 'tooltip', content };type: 'text'keeps it visible. - Import
OverflowListfrom@wallarm-org/design-system/OverflowList; pass it a stableitemsarray (row.original.groups). There is nomaxItems. - Tests: pass
data-testidtoTable; never select bydata-slot.
Examples
The whole table: the cell vocabulary, the row menu in the master cell, sorting and a bulk bar for selected rows.
Adds an ID in Code and an exact time to the Cells vocabulary. Sort by any header; select
rows to bring up the bulk bar.
A person with a second line, a status badge, groups as tags, and a number whose header explains it.
Tags collapse into "+N" when the column runs out of room; a user with no groups or no requests
shows —.
The row menu: the trigger names the row, and the destructive item comes last and names the entity.
Hover a row: the … appears in the master cell, meta.renderMenuAction on the first column. The
trigger names the row and the destructive item comes last.
First load keeps the header and fills the body with placeholder rows.
isLoading draws the skeleton rows, not a Loader; skeletonCount sets how many (12 by
default).
Nothing created yet: an empty state under the header.
EmptyState type='collection-empty' inside TableEmptyState. It has no button when the page
header already has Create.
States
What your app owns
Related
- Resource list page: the page shell.
- Detail drawer: opens from a row.
- Confirmation dialogs: confirm deletes.
- Feedback toasts: report results.
- Empty states, Filtering, Spacing.