DataTable

DataTable is a 2-dimensional data structure where each row is an item, and each column is a data point about the item.

Page navigation navigation

React examples

Default

Repositories

RepositoryTypeUpdatedDependabotCode scanning
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

With custom column widths

Column sizing guidelines

Repositories

grow w/ 200px maxgrowCollapse w/ 100px minauto200pxundefined (defaults to grow)
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

Columns text alignment

  • Left (default): Follows natural reading direction in right-to-left writing systems.
  • Right-aligned columns are used for numbers and other data that is best represented right-aligned.

In this example, there is a "Pull requests" column that is right-aligned to make it easier to visually scan and compare the numbers.

Repositories

RepositoryPull requestsTypeUpdated
codeql-dca-worker12InternalFeb 25, 2025
aegir34PublicFeb 25, 2025
strapi8PublicFeb 25, 2025
codeql-ci-nightlies1PublicFeb 25, 2025
dependabot-updates57PublicFeb 24, 2025
tsx-create-react-app35PublicFeb 18, 2025
bootstrap42PublicJan 28, 2025
docker-templates3PublicDec 3, 2024

Table cell density

  • Condensed: Maximizes data visibility in a small area.
  • Normal (default): Balances data display with whitespace for clarity.
  • Spacious: Enhances readability for dense or complex content.

This example uses 'spacious' table cell padding.

Repositories

RepositoryTypeUpdatedDependabotCode scanning
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

Sort rows by column data

If a table is sortable, one column must be sorted by default. Clicking a sorted column toggles between ascending and descending; unsorted columns sort in ascending order on first click.

In this example, the rows are sortable by "Repository" and "Updated" column data.

Repositories

TypeDependabotCode scanning
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

With title and subtitle

Table header guidelines

Repositories

A subtitle could appear here to give extra context to the data.

RepositoryTypeUpdatedDependabotCode scanning
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

With table action

Table header guidelines

Repositories

A subtitle could appear here to give extra context to the data.

RepositoryTypeUpdatedDependabotCode scanning
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

With single row action

Actions that affect the item represented in the row are placed in the last column, and they don't require a visible column header.

Repositories

RepositoryTypeUpdatedDependabotCode scanning
Actions
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025
codeql-ci-nightliesPublicFeb 25, 2025Alerts
dependabot-updatesPublicFeb 24, 2025
tsx-create-react-appPublicFeb 18, 2025
bootstrapPublicJan 28, 2025Alerts
docker-templatesPublicDec 3, 2024Alerts

With multiple row actions

If you have multiple actions for a row, start by pulling them into a dropdown menu.

If one of the actions is heavily used, pull it out for easier access. Do not pull out more than 1 action.

Row actions in a dropdown

RepositoryTypeUpdatedDependabotCode scanning
Actions
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025

Row actions inline

RepositoryTypeUpdatedDependabotCode scanning
Actions
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025

Row actions overflowing

RepositoryTypeUpdatedDependabotCode scanning
Actions
codeql-dca-workerInternalFeb 25, 2025AlertsReport secrets
aegirPublicFeb 25, 2025AlertsReport secrets
strapiPublicFeb 25, 2025

With paginated rows

The pagination footer shows the user where they are in relation to the total number of rows and provides controls for navigating all rows.

Guidelines on when to paginate rows

Repositories

RepositoryTypeUpdatedDependabotCode scanning
Repository 1InternalFeb 25, 2025
Repository 2PublicFeb 24, 2025
Repository 3PublicFeb 23, 2025
Repository 4InternalFeb 22, 2025
Repository 5PublicFeb 21, 2025
Repository 6PublicFeb 20, 2025
Repository 7InternalFeb 19, 2025
Repository 8PublicFeb 18, 2025
Repository 9PublicFeb 17, 2025
Repository 10InternalFeb 16, 2025

In a loading state

DataTables use "skeleton" loading states to indicate loading content.

Table loading state guidance

Repositories

RepositoryTypeUpdatedDependabotCode scanning
Loading
Loading
Loading
Loading
Loading

More code examples

The previous examples are a curated subset of the full capabilities of the DataTable component. For more examples, see the DataTable Storybook stories.

Props

Loading data for data_table...