Overview
Use DataTable when people need to compare structured values across many records and act on individual or selected rows.
Enterprise projects
Sortable headers, selection, status, and row actions support a common operational workflow.
| Owner | Status | Updated | Actions | ||
|---|---|---|---|---|---|
| Audit reportingPRJ-1019 | Sofia Martin | Active | 2026-08-05 | ||
| Billing controlsPRJ-1038 | Noah Williams | At risk | 2026-08-12 | ||
| Enterprise migrationPRJ-1042 | Maya Chen | Active | 2026-08-14 | ||
| Identity refreshPRJ-1024 | Aarav Shah | Complete | 2026-08-08 |
0 of 4 rows selected
Anatomy
A data table combines a caption, column headers, rows, cells, optional selection, status, and row actions.
- 1Header rowRequired
Names columns and exposes sorting state.
- 2Data rowRequired
Represents one record with a stable identifier.
- 3CellRequired
Displays one value or a contextual action.
- 4Selection control
Selects one row or all eligible rows.
- 5CaptionRequired
Programmatically names the table.
When to use
Choose DataTable for structured records where column alignment materially improves comparison.
Recommended
- Compare records
Use when values share a consistent schema and people scan across columns.
- Manage operational data
Support sorting, selection, status, and row-level actions.
- Handle changing data volumes
Combine with filtering and Pagination at the workflow level.
When not to use
Prefer simpler structures when records are sparse, highly visual, or do not share comparable fields.
Avoid
- Do not use for simple key-value details
Use a description list or structured detail view for one record.
- Do not use for media-first collections
Use Card or List when imagery and narrative content drive recognition.
- Do not force every action into a column
Keep rare actions in an accessible row menu.
Variants
Surface and density variants adapt the same semantic structure to hierarchy and information volume.
Plain
Default for tables already contained by a page section.
Bordered
Creates a clear boundary on open surfaces.
Striped
Supports horizontal tracking across wide tables.
Density
Small, medium, and large preserve a minimum 44px interaction target.
States
Table state explains data availability, row interaction, selection, and active sorting.
| State | Trigger | Visual response | Interaction |
|---|---|---|---|
| Default | Data is available | Headers and rows at selected density | Cells and actions can be scanned |
| Hover | Pointer enters a row | Row surface is emphasized | Supports horizontal tracking |
| Selected | Selection checkbox changes | Selection control and row surface update | Bulk actions can consume selected IDs |
| Sorted | Sortable header is activated | Direction icon and aria-sort update | Rows reorder by the active column |
| Loading | Data request is pending | Announced loading row | Duplicate operations are prevented |
| Empty or error | No results or request failure | Message spans the table width | Recovery guidance remains available |
Behavior
Sorting and selection support controlled and uncontrolled usage while row identity remains stable across reordering.
Sort cycle
Sortable headers cycle ascending, descending, and unsorted.
Selection
Select-all affects eligible rows and preserves disabled-row state.
Overflow
Wide tables scroll horizontally without collapsing column meaning.
Sticky header
Headers remain visible when a containing region scrolls vertically.
Accessibility
DataTable uses native table elements so header relationships and navigation remain available to browsers and assistive technology.
| Key | Action |
|---|---|
| Tab | Moves through sortable headers, selection controls, and row actions. |
| EnterSpace | Activates the focused sort, selection, or row action. |
| ShiftTab | Moves to the previous interactive table control. |
- Provide a descriptive caption.
- Use th with scope="col" for every header.
- Expose active sorting with aria-sort.
- Give selection and row actions unique accessible names.
- Do not communicate status or selection with color alone.
- Keep horizontal overflow keyboard reachable.
- Preserve at least 44px interactive targets.
Content guidelines
Headers and cells should make comparison fast without sacrificing precision.
Use concise headers
Name the value rather than describing the column.
Updated
Keep formats consistent
Use one date, currency, number, and status format within a column.
14 Aug 2026
Align by data type
Start-align text and end-align comparable numeric values.
₹48,200
Explain empty results
Differentiate no data from no filter matches and loading failure.
No projects match these filters.
Examples
Controlled sorting and selection let application state coordinate bulk actions, filters, and persistence.
Interactive selection and sorting
Select rows and sort the Project column in the live semantic preview.
| Owner | Status | Updated | Actions | ||
|---|---|---|---|---|---|
| Audit reportingPRJ-1019 | Sofia Martin | Active | 2026-08-05 | ||
| Billing controlsPRJ-1038 | Noah Williams | At risk | 2026-08-12 | ||
| Enterprise migrationPRJ-1042 | Maya Chen | Active | 2026-08-14 | ||
| Identity refreshPRJ-1024 | Aarav Shah | Complete | 2026-08-08 |
0 of 4 rows selected
Props / API
DataTable is generic over the row type and extends div attributes for its responsive container.
Props