Tables display sets of related data across rows and columns, making it easier for users to compare and analyze information. This page covers usage patterns built on top ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/zendeskgarden/website/llms.txt
Use this file to discover all available pages before exploring further.
@zendeskgarden/react-tables.
Anatomy
A table has three structural parts:- Columns — vertical groupings that categorize and prioritize data
- Header row — describes the data in each column
- Data rows — horizontal groups of data beneath the headers
A table must have at least 2 columns. For single-column data, use a List component instead.
Formatting
Size
Tables come in three sizes:| Size | When to use |
|---|---|
| Medium (default) | Most situations — accommodates information density well |
| Large | When Avatars are introduced into rows, creating more breathing room |
| Small | When greater information density is needed |
Column alignment
| Content type | Alignment |
|---|---|
| Text | Left |
| Categorical data with numbers (dates, phone numbers) | Left |
| Quantitative / numeric data | Right |
| Tags or Avatars | Left |
| Icons | Center |
Row heights
Header rows should be visually taller than body rows to create clear separation between the header and data. Do not use identical heights for header and body rows.Header cell content
- Use one or two nouns that quickly help users understand what data is in the column
- Avoid verbs in header labels to prevent confusion with CTAs
- Use sentence case
- Mark up header cells with
<HeaderCell>(renders as<th>) for accessibility
Wrapping and truncation
Text wrapping is the default and recommended behavior. Ensure cells in a row are top-aligned. To truncate long text, useEllipsis and provide a title attribute that appears on hover:
Variations
Striped rows
Use striped rows when a table has many rows of data to help users keep their place when scanning horizontally.Grouped rows
Use grouped rows to create additional categorization of similar items. Guidelines:- Use only when groups contain 10 or more items
- Avoid overuse — it produces busy layouts
- Do not combine striped and grouped rows
Sorting
Sorting is implemented by selecting sort controls in table headers. Behavior:- First click: ascending order (A→Z, 1→9, oldest→newest)
- Second click: descending order
- Third click: removes sorting
Only one column can be sorted at a time. The currently sorted column must always show its sort direction indicator.
Row selection
Use checkboxes in rows to allow users to select one or more items. In paginated tables, selection only affects the current page.Select all
The select-all checkbox in the header selects all rows on the current page only. Users should only be able to act on what they can see.Bulk actions
When rows are selected, surface bulk action controls above the table. Common bulk actions include Delete, Export, Assign, and Tag.Empty states
When a table has no data, show an empty state inside the table body — not a blank table skeleton.Loading states
UseSkeleton loaders inside table cells to indicate a section is loading. Do not show a blank table or a spinner centered over the entire table.
- Show skeleton loaders in the first 3 rows — this is enough to convey loading
- Keep header cells visible at all times to provide instant context of incoming data
- Skeleton height should be 60% of the font size; width should approximate actual content width
Pagination
Pair the table with thePagination component.
Cursor pagination (recommended)
Use cursor pagination for real-time or frequently updated data. There is no concept of total page count.Offset pagination
Use offset pagination when you know the total number of records.Draggable rows
To enable row reordering, apply drag-and-drop functionality using dnd-kit. See the Drag and drop patterns page for full guidance.Row actions
View and edit
“View” or “Edit” actions should appear within data cells in the first column and also in the overflow menu — giving users two ways to reach the same content.Overflow menu
All additional actions belong inside the overflow menu. Group complementary actions with separators, and place destructive actions below a separator using theisDanger prop.
Accessibility
- All Garden tables use accessible markup (
<th>,<td>,caption/aria-describedby) - Every table must have a
Captionoraria-describedbyattribute that identifies or describes the table - Informational icons in cells must include a
titleattribute andaria-label - Overflow buttons must have a descriptive
aria-label(e.g.,"Actions for ${row.name}") - Screen readers navigate tables cell by cell and announce the associated header context automatically