Components · Data Display · Table
Back to Table typesTable
Use for displaying structured data across fixed columns, like an admin data grid or a report view - one Table component, controlled by properties, not a one-off grid of divs rebuilt per screen.
Properties
Corner radius, size and the header row are properties of the same component, not separate tables - change them below to check this table's types and states in the Live Preview.
Live Preview
Both types compared side by side, each in all 5 states - plain rows, Striped for alternating row backgrounds, Selected showing a checkbox column with one row highlighted, Loading, and Empty. One full matrix is rendered per selected combination of Corner radius and Size, with the current Show header setting applied throughout.
When to use
Any time structured data needs to be shown across fixed columns rather than as a list or grid of cards.
Selection
Row selection is one of three modes per table instance, not a single on/off switch - pick the one that matches what an action needs to operate on.
- None - rows aren't selectable. No checkbox column, no row highlight on click; a click (if it does anything) navigates or expands the row instead of selecting it.
- Single-row - clicking a row selects it exclusively, like a radio group: selecting a different row clears the previous selection. Use when exactly one record is ever acted on at a time.
- Multi-row (checkbox column) - a leading checkbox column: one checkbox per row, plus a header checkbox that selects or deselects every row currently visible. When some but not all visible rows are checked, the header checkbox renders indeterminate - a dash, not a checkmark or an empty box - rather than falsely claiming everything or nothing is selected.
Keyboard: a selectable row is a focusable element (tabindex="0"); pressing Space while a row has focus toggles that row's selection, without requiring the pointer to land precisely on the checkbox.
Sort
Sorting can happen entirely in the browser or round-trip to the server, depending on how much of the dataset is already loaded.
- Client-side sort - re-orders rows already loaded in memory. Fine for small, fully-loaded datasets where every row is already on the page.
- Server-side sort - re-requests the current page/window from the server on every sort change. Required once pagination or virtualization is itself server-driven, so sorting one column doesn't mean silently fetching the entire dataset just to reorder it locally.
- Multi-column sort - single-column sort is the default; supporting a secondary sort key (e.g. shift-click a header to add it) is an opt-in advanced behavior, not something every Table instance is required to implement.
Accessibility contract - per WCAG 2.1 Success Criterion 4.1.3 (Status Messages), a sortable column header must expose its current state via aria-sort="ascending", aria-sort="descending" or aria-sort="none" on the <th>, update that attribute the instant the sort changes, and announce the change to assistive technology - a visual arrow icon alone is not sufficient.
Filter
Filtering narrows which rows show, through either a scoped per-column control or a single global search - and the resulting empty state needs to say which situation it is.
- Per-column filter - a control scoped to one field, e.g. a status dropdown inside the Status column's header, narrowing on that attribute alone.
- Global search bar - one search input above the table that matches across every visible column at once, for a user who doesn't know which column their query lives in.
"No rows match" is not the same empty state as "no data at all." A filtered-to-zero result (rows exist, the current filter or search just matched none of them) should say so and offer a "Clear filters" action; the true empty state (no data exists, prior to any filter) should instead offer a call-to-action to create the first record. Rendering the same message for both hides the fact that data exists somewhere but the filter is too narrow.
Pagination vs. Virtualization
A Table doesn't scale linearly in the DOM as row count grows, so which rendering strategy applies depends on how many rows are in play.
- Below 500 rows - client-side pagination, or simply rendering every row at once, is fine. The DOM cost is small and bounded.
- At or above 500 rows - virtualization (windowed rendering, where only the rows in or near the current viewport are ever mounted) is required. A table row is not a cheap DOM node - each one carries multiple cells, and often interactive controls (checkboxes, action buttons) with their own event listeners - so total DOM node count and layout/reflow cost grow far faster than linearly with row count once a table passes a few hundred rows.
Density
A two-value row-height property, independent of the Size property already shown above in Live Preview.
- Comfortable - the default row height and cell padding, matching what's shown throughout this page's Live Preview.
- Compact - reduced row height and cell padding, for scanning more rows within the same viewport height.
A sitewide density mode now exists (Settings → Density, backed by a data-density attribute the same way theme is), but Table's Size property above is still its own local control and isn't wired to that sitewide setting yet - the two aren't the same switch. Promote Table's Size onto the sitewide toggle once another data-dense component (List, Description) needs the same switch, rather than each maintaining its own.
Required States
A real, data-backed Table has no fallback "shape" the way this page's static demos do - empty, loading and error all need an explicit, intentional rendering, not an accidental one.
Empty (no data at all)
Do
| Name | Status |
|---|---|
No team members yet Invite someone to get started. | |
Reuses the Empty component (icon, title, description) plus a call-to-action that matches the table's content, inside one spanning cell.
Don't
| Name | Status |
|---|
A header with a silently blank body reads as broken or still loading, never as "there's nothing here yet."
Loading
Do
| Name | Status |
|---|
Skeleton rows matching the real column count keep the table's shape stable, so it doesn't jump once data arrives.
Don't
| Name | Status |
|---|---|
No results | |
Showing the same "No results" empty state while a fetch is still in flight misreports that there's no data - rows popping in a moment later contradicts what was just displayed.
Error
Do
| Name | Status |
|---|---|
Names what happened and gives a Retry action, inside the same spanning cell used by the other states.
Don't
| Name | Status |
|---|---|
No results | |
A failed request that silently renders the same empty state as a true zero-result answer gives the user no way to tell the two apart, and no path to retry.
Component Guide
Overview
Table displays structured data across fixed columns, like an admin data grid or a report view - rows and columns that let a user compare values across many records at once, unlike List's simpler stacked-row layout with no column alignment.
When to Use
- An admin data grid or user management list - structured records compared across shared columns.
- Order history or a report/analytics view - tabular data where column alignment aids comparison.
- An inventory listing - any dataset naturally organized into consistent fields per row.
When Not to Use
- A simple stack of similar items with no meaningful column structure - use List instead - Table's column overhead isn't worth it for unstructured rows.
- A small number of visually distinct content blocks - use Card or a grid of Cards.
- Data better suited to a single set of label/value pairs - use Description for one record's details rather than a one-row table.
Best Practices
- Keep column headers concise and consistently aligned with their column's data type (numbers right-aligned, text left-aligned).
- Support sorting on columns where order genuinely helps comparison, and clearly indicate the active sort.
- Pair large tables with pagination, virtualized scrolling, or both - virtualize once a table is showing 500+ rows, rather than rendering thousands of rows at once.
Do and Don't
Do
| Name | Status |
|---|---|
| Aria Chen | Active |
| Leo Fischer | Invited |
Column headers that name exactly one kind of value each, so every cell in a column is comparable to the one above it.
Don't
| Details |
|---|
| Aria Chen - active - joined Jan 2024 - admin |
| Leo Fischer, invited, pending since last week |
Collapsing several fields into one free-text column removes the ability to sort, filter or scan by any single attribute - it stops being a table.
Accessibility
- Uses real table semantics (thead/tbody/th with proper scope), so screen readers can announce row/column context for each cell.
- Sortable column headers are real, keyboard-operable buttons that announce the current sort direction.
- Row selection checkboxes are independently labeled with which row they apply to.
- Per WCAG 2.1 Success Criterion 4.1.3 (Status Messages), a sortable header sets
aria-sort="ascending",aria-sort="descending"oraria-sort="none"and announces the change - a visual arrow icon alone is not sufficient.
Related Components
List, Pagination, Description.
{
"component": "Table",
"category": "Data Display",
"summary": "Table displays structured data across fixed columns, like an admin data grid or a report view - rows and columns that let a user compare values across many records at once, unlike List's simpler stacked-row layout with no column alignment.",
"whenToUse": [
"An admin data grid or user management list - structured records compared across shared columns.",
"Order history or a report/analytics view - tabular data where column alignment aids comparison.",
"An inventory listing - any dataset naturally organized into consistent fields per row."
],
"whenNotToUse": [
"A simple stack of similar items with no meaningful column structure - use List instead - Table's column overhead isn't worth it for unstructured rows.",
"A small number of visually distinct content blocks - use Card or a grid of Cards.",
"Data better suited to a single set of label/value pairs - use Description for one record's details rather than a one-row table."
],
"bestPractices": [
"Keep column headers concise and consistently aligned with their column's data type (numbers right-aligned, text left-aligned).",
"Support sorting on columns where order genuinely helps comparison, and clearly indicate the active sort.",
"Pair large tables with pagination, virtualized scrolling, or both - virtualize once a table is showing 500+ rows, rather than rendering thousands of rows at once."
],
"doAndDont": {
"do": "Column headers that name exactly one kind of value each, so every cell in a column is comparable to the one above it.",
"dont": "Collapsing several fields into one free-text column removes the ability to sort, filter or scan by any single attribute - it stops being a table."
},
"accessibility": [
"Uses real table semantics (thead/tbody/th with proper scope), so screen readers can announce row/column context for each cell.",
"Sortable column headers are real, keyboard-operable buttons that announce the current sort direction.",
"Row selection checkboxes are independently labeled with which row they apply to.",
"Per WCAG 2.1 Success Criterion 4.1.3 (Status Messages), a sortable header sets aria-sort=\"ascending|descending|none\" and announces the change - a visual arrow icon alone is not sufficient."
],
"selection": {
"modes": ["none", "single-row", "multi-row"],
"multiRowCheckboxHeader": "Indeterminate (not checked, not unchecked) when some but not all visible rows are selected.",
"keyboard": "Space toggles selection on a focused row."
},
"sort": {
"clientSide": "Re-orders already-loaded rows in memory - fine for small, fully-loaded datasets.",
"serverSide": "Re-requests the current page/window from the server on every sort change - required once pagination or virtualization is server-driven.",
"multiColumn": "Not on by default - single-column sort unless explicitly extended with shift-click to add a secondary sort key.",
"accessibility": "Per WCAG 2.1 Success Criterion 4.1.3 (Status Messages), a sortable header must expose aria-sort=\"ascending|descending|none\" and announce the change to assistive technology."
},
"filter": {
"perColumn": "A filter control scoped to a single column's field.",
"global": "A global search bar above the table, matching across every visible column.",
"emptyStates": "\"No rows match\" (filtered-to-zero, offer Clear filters) must read differently from the true empty state (no data exists at all, offer a create action)."
},
"paginationAndVirtualization": {
"thresholdRows": 500,
"belowThreshold": "Client-side pagination (or simple full rendering) is sufficient.",
"atOrAboveThreshold": "Virtualization (windowed rendering) is required - a table row is not a cheap DOM node, and DOM/layout cost does not scale linearly with row count past a few hundred rows."
},
"density": {
"modes": ["comfortable", "compact"],
"note": "Two-value property local to Table's own Size control, not yet wired to the sitewide data-density attribute (Settings -> Density) that now exists for the shell frame/panels."
},
"requiredStates": ["empty", "loading", "error"],
"relatedComponents": [
"List",
"Pagination",
"Description"
]
}