DataTable enables users to act upon complex datasets with a variety of features including filtering and sorting.
[WIP image]
Tables are used to display, organize, compare, or format tabular data. Our DataTable is an opinionated and custom table built for users to multiselect rows, sort, and filter the data to their needs. While the DataTable is intended for more complex datasets with multiple fields, it can still be used for simple sets.
Historically, HTML tables were once used to arrange elements on a webpage before modern CSS layout tools like flexbox and grid existed. Never use the DataTable or any table for layout purposes. We provide components specialized in building layouts, such as the Box and Grid. For more information and the full list of available components, see our "Layout" section under "Components."
The DataTable includes, but is not limited to, the following list of features.
We recommend only adding the most necessary features as too many options may be overwhelming for users. For the complete list of features, see Behaviors.
It's not uncommon for more complex datasets to include more fields. These fields are represented by additional columns. The more columns that are included by default, the more difficult it becomes for the user to understand the data presented. Keep only the minimum amount of columns necessary for data to be visible and readable. Allow users the option to show and hide extra columns as necessary.
Be aware that horizontal scrolling is only available for non-fixed DataTables.
Location | Region | Climate | Elevation (ft) | Terrain | Avg temp |
|---|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | Hills | 52°F |
| Cedar Bay | West | Maritime | 120 | Coastal | 61°F |
| Pine Valley | Central | Continental | 890 | Valley | 48°F |
| Aspen Creek | East | Subtropical | 1,560 | Forest | 66°F |
Location | Region | Climate | Elevation (ft) | Terrain | Avg temp | Rainfall | Nearest city | Access road |
|---|---|---|---|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | Hills | 52°F | 38 in | Springfield | Route 7 |
| Cedar Bay | West | Maritime | 120 | Coastal | 61°F | 45 in | Riverside | Highway 1 |
| Pine Valley | Central | Continental | 890 | Valley | 48°F | 28 in | Midtown | Route 30 |
| Aspen Creek | East | Subtropical | 1,560 | Forest | 66°F | 52 in | Lakewood | Route 12 |
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Basic tables are non-interactive and more suitable for simpler, comparative lists of data.
| Maple Ridge | North | Temperate | 2,450 | |
| Cedar Bay | West | Maritime | 120 | |
| Pine Valley | Central | Continental | 890 | |
| Aspen Creek | East | Subtropical | 1,560 |
Interactive tables include functionality for users to act on the available data, including search, filter, sorting, and row selection.
Layout determines how the DataTable reacts to its content. By default, tables are fixed in size and cells will not accommodate their content. Use fixed layouts for predictable table sizing.
Auto layout allows cells to accommodate their content size and enables horizontal scrolling. Use auto layouts when column content must be easily readable.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Columns are divided equally regardless of cell content size. Horizontal scrolling is disabled.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Columns adjust automatically to cell content size. Horizontal scrolling is enabled.
Column widths may be customized to defined widths or constrained to minimum and maximum width values.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Columns can be set to defined width values.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Columns can be constrained by minimum and maximum values.
Highlighting changes a row's background color on mouse hover. Rows are highlighted automatically when they're selectable, but this can be manually enabled on non-selectable rows.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Rows are highlighted on mouse hover.
In addition to the base styles, the DataTable includes two additional row styles: striped and borderless.
Striped style alternates between two neutral background colors to improve the table's readability. This can be helpful for tables with large amounts of data, especially where infinite scrolling is enabled.
Borderless style removes the border between rows. This can be used for a cleaner presentation on tables with smaller datasets.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Rows have a consistent background color with a border between each entry.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Rows alternate between two background colors to improve readability.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Rows have no borders separating each entry.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
At rest, the table displays existing data with no active interactions.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
Skeleton loaders are displayed while data is being returned. Expected row count can be estimated by setting a predefined number of rows.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
No results foundTry adjusting your search or filters. | |||
Empty states display when there is no data to show. Use the existing empty state or provide a custom empty state to help users understand how to proceed.
2 selected | Location | Region | Climate | Elevation (ft) |
|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | |
| Cedar Bay | West | Maritime | 120 | |
| Pine Valley | Central | Continental | 890 | |
| Aspen Creek | East | Subtropical | 1,560 |
Selected rows are highlighted with a blue background and checked input field.
Filters let users narrow down results by selecting from predefined options, such as a status or category. Filters appear in the table header and can be combined to refine the data shown.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Filter controls appear in the header, allowing users to select criteria and narrow the displayed results.
Enabling infinite scrolling (virtualization) allows the table to load large datasets incrementally without a drop in performance as the user scrolls. This can be used an alternative to pagination.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
Infinite scrolling allows large datasets to be scrolled without performance issues.
Pagination allows users to handle large datasets by separating them into different pages. Controls are displayed under the table and allow the user to select how many results are displayed per page.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
Pagination is used to control how many results are displayed at once for larger datasets.
Search enables users to filter table data by keyword. The search input is located in the table header and filters across all columns by default. For large datasets, use manual (server-side) search to avoid performance issues.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Search enables users to filter data by keyword using an input field in the table header.
Column settings allow users to show and show columns as needed. Extra columns are accessed through a dropdown menu within the table header.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Columns can be toggled for visibility through a dropdown menu in the table header.
Cells may span multiple columns if necessary. This can be used to show that information may not be available or communicate inline status messages about the associated entry.
Name | Email | Role |
|---|---|---|
| Alice | alice@example.com | Admin |
| Bob | ||
| Charlie | charlie@example.com | Viewer |
| Diana | diana@example.com | Admin |
Cells can span multiple columns. This is useful for conveying special information about this entry.
Column sorting allows users the flexibility to organize data. Sorting can be done either by activating a column header or selecting options from the "Sort" dropdown in the table header. Sorting is handled in either ascending or descending order.
| Maple Ridge | North | Temperate | 2,450 |
| Cedar Bay | West | Maritime | 120 |
| Pine Valley | Central | Continental | 890 |
| Aspen Creek | East | Subtropical | 1,560 |
Sorting is enabled by activating a column header or the dropdown in the table header.
Actions such as editing, deleting, or viewing row details can be performed on individual rows. Row actions are placed within a dropdown menu in the last cell of each row.
Location | Region | Climate | Elevation (ft) | |
|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | |
| Cedar Bay | West | Maritime | 120 | |
| Pine Valley | Central | Continental | 890 | |
| Aspen Creek | East | Subtropical | 1,560 |
Row actions such as edit and delete are housed within a dropdown menu in the last cell of the row.
Bulk actions appear in the table header when one or more rows are selected. The main, promoted action renders as a button separate from the actions within the dropdown button.
2 selected | Location | Region | Climate | Elevation (ft) |
|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | |
| Cedar Bay | West | Maritime | 120 | |
| Pine Valley | Central | Continental | 890 | |
| Aspen Creek | East | Subtropical | 1,560 |
When rows are selected, the header transforms to show the selection count and available bulk actions.
Similar to an accordion, row expansion displays additional information about the row directly under it without forcing the user to navigate away from the table. Rows that can be expanded are denoted by an expansion toggle icon.
Location | Region | Climate | Elevation (ft) | |
|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | |
| Cedar Bay | West | Maritime | 120 | |
| Pine Valley | Central | Continental | 890 |
Rows with expansion toggle icons can be expanded to reveal supplementary information about that row.
Row selection allows users to pick one or more rows to act on. Selected rows are visually highlighted with a checked input and different background color. Row selection allows users to perform bulk actions on multiple entries at once.
Location | Region | Climate | Elevation (ft) | |
|---|---|---|---|---|
| Maple Ridge | North | Temperate | 2,450 | |
| Cedar Bay | West | Maritime | 120 | |
| Pine Valley | Central | Continental | 890 | |
| Aspen Creek | East | Subtropical | 1,560 |
Each row includes a checkbox for selection. A header checkbox selects or deselects all visible rows.
DataTable captions are important for providing assistive technology information about the table's purpose and the type of data it contains. Short, descriptive nouns or noun phrases work best for captions.
Note: Captions are not visible to the user but are required for displaying the table.
Column headers should clearly describe the data in each column. Write headings in sentence case and avoid abbreviations where possible.
Location name | Region | Elevation (ft) |
|---|---|---|
| Maple Ridge | North | 2450 |
| Cedar Bay | West | 120 |
Loc Nms | Rgn | Elv |
|---|---|---|
| Maple Ridge | North | 2450 |
| Cedar Bay | West | 120 |
Provide a clear and meaningful Empty State message and action when no data is available. This ensures users that the component is functioning correctly but may need data or user attention.
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
No locations yetAdd your first location to get started. | |||
Location | Region | Climate | Elevation (ft) |
|---|---|---|---|
No data available | |||