Table Component: Row Actions & Selection
Tables support interactive items, row actions, expandable sections, and multi-row selection.
Row Actions
Use the rowActions prop to render action menus on each row.
1. Dropdown Action Menu (Recommended)
For a clean and consistent UI, group row-level actions into a 3-dots dropdown menu using ActionsDropdown (or ActionsMenu) and ActionItem:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
ActionItem Properties
| Property | Type | Description |
|---|---|---|
title |
string |
Action label text. |
action |
() => void |
Click handler callback. |
iconNode |
ReactNode |
Icon element (use Phosphor icons with weight="bold"). |
disabled |
boolean |
Disables the menu item. |
className |
string |
Custom CSS class string (e.g. 'text-danger'). |
iconColor |
string |
Visual variant color theme (e.g. 'danger', 'success'). |
2. Inline Row Action Buttons
For simple tables with very few actions, you can render buttons directly in the row cells:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Expandable Rows
Expandable rows show extra details without navigating away.
1 2 3 4 5 6 7 8 9 10 11 12 | |
The caret in the first visible column is a real button: it takes keyboard focus, exposes aria-expanded, controls the details cell (aria-controls) while it is open, and is named "Expand"/"Collapse" plus that cell's text ("Expand Web server"). Make the first visible column one that identifies the row, such as its name. Clicking anywhere else on the row still toggles it.
Conditional Expandability (isRowExpandable)
By default, all rows display carets if expandableRow is present. Disable card expansion for specific rows using isRowExpandable:
1 2 3 4 5 6 | |
Bulk Selection and Actions
Tables support row selection and bulk batch actions in the toolbar.
- Set
enableMultiSelectto render selection checkboxes on each row. - Pass a component to
multiSelectActionsto render bulk operations on the selected items. It receives the selectedrowsandrefetchcallback. - For destructive actions, use the
RemovalActionButtonto prompt users with a confirmation panel before execution.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |