Browse Components

Components

Data table

A data table is designed for managing and displaying large datasets with interactive features that enhance usability and accessibility. It allows users to analyse, sort, and manipulate data efficiently.

DesignUsageAccessibilityUpdates

Purpose

Compare records

Use data tables when each row shares the same set of fields.

Navigate long datasets

Built-in pagination helps users move through many records.

Act on rows

Support sorting, selection, and expandable details where needed.

Anatomy

Application Status Amount Action GST-2026-001 Approved 1,250.00 ViewEdit
Submitted by Operations on 12 Mar 2026.
GST-2026-002 In review 850.00 ViewEdit GST-2026-003 Draft 640.00 ViewEdit
1

Header row

2

Data row

3

Expanded panel

4

Footer (optional)

5

Expand indicator

6

Checkbox

7

Header cell

8

Sorting (optional)

Configuration

Header props

Configure header cells with supported sgds-data-table-head props.

ID Name Role 1 Lina Engineer 2 Adam Engineer

Set sorting and sortKey on headers that should sort rows.

Row expansion

Use supported sgds-data-table-row props for expandable row details.

First name Last name Username John Doe @johndoe
More details about John Doe.
Jane Doe @janedoe

Set expand on rows that reveal detail content.

Row selection

Use multiSelect on the table and checked on rows for selection states.

First name Last name Username John Doe @johndoe Jane Doe @janedoe

Set multiSelect to render a checkbox column for row selection.

Pagination

Configure result count, items per page, summary text, and pagination variant.

ID Name 1 Amy

Use currentPage, dataLength, and itemsPerPage for default pagination.

Mode and server sort

Choose client or server pagination, and use serverSort when an API handles sorting.

ID Name 1 Amy 2 Ben 3 Cara

Default. Client mode slices slotted rows and handles local sorting.

Data state

Use the built-in loading and no-data states shown in Storybook.

First name Last name Username

With no body rows, the table shows the default no-data state.

Table layout

Choose how the browser sizes columns inside the data table.

ID Name Role 1 Amy Tan Operations lead

Default. Use layout="auto" to let content influence column sizing.

Structure

Application Status Amount Action GST-2026-001 Approved 1,250.00 ViewEdit GST-2026-002 In review 850.00 ViewEdit

Design tokens used

Each row is a colour, spacing, or size value the component uses, and the right-most column tells you where in the component you'll see it.

CategoryTokenValueWhere it's usedPaddingsgds-padding-sm—Vertical padding of cells, footer, skeleton rows, and no-data contentsgds-padding-md16pxHorizontal padding of cells, skeleton rows, and no-data contentsgds-padding-lg20pxHorizontal padding of the footersgds-padding-2-xl32pxPadding of expanded row contentsgds-padding-4-xl—Left padding of expanded row contentGapsgds-gap-2-xs4pxSpacing between header text and sort controlBordersgds-border-width-11pxBorder around the data table and divider between rowssgds-border-radius-none—Corner radius of the data table containersgds-form-border-radius-sm—Corner radius of the sort buttonTypographysgds-font-family-brand—Font family of table contentsgds-font-size-label-sm—Font size of table contentsgds-font-weight-semibold—Font weight of header cellssgds-font-weight-regular—Font weight of body cellssgds-line-height-2-xsHeight variesLine height of table contentsgds-letter-spacing-normal—Letter spacing of table contentOutlinesgds-outline-focus—Focus outline of sortable headers and sort buttonssgds-outline-offset-focus—Focus outline offset of sortable headers and sort buttons

Usage

When to use

  • Use a data table to display and manage structured datasets, where each row represents a record and each column represents a shared field.
  • Use it when users need built-in features to work with the dataset, such as sorting, pagination, row selection or expandable rows.
  • Use it when the data changes or is loaded over time and you need to represent states and behaviours such as loading, no data, or server-side sorting and pagination.

When not to use

  • Do not use a data table when you only need to present already-prepared information in rows and columns without built-in data management features. Use a table instead.
  • Do not use a data table for information that is better presented as a list, card or description list.

Best practices

Application ID Status Amount APP-0421 In review 1,250.00 APP-0422 Approved 850.00
Use data tables for interactive datasets

Use a data table when records need built-in behaviours such as sorting, pagination, selection, loading states, or expandable row details.

Office Opening hours Service counter 9am to 5pm Call centre 8am to 8pm
Do not use data tables for static tables

If the content is already prepared and does not need built-in data management features, use a table instead.

Case ID Owner Status CASE-2041 Amy Tan Open
Use clear headers and stable sort keys

Set sorting and sortKey only on columns users can compare. This gives client sorting and server sort events a stable field name.

ID Action 1 View 2 View
Do not make action columns sortable

Keep sorting to data columns. Action and control columns should not emit sort events.

Application ID Status Submitted
Use loading and no-data states

Set loading while rows are being fetched, and use the no-data slot when the current query returns no records.

Name Agency Role Lim Wei Ming Ministry of Finance Officer
Do not use a data table for one record

For attributes of a single item, a description list shows the label-value relationship more clearly.

Accessibility considerations

Built-in accessibility

Data table renders table semantics from composed SGDS row, header, and cell elements.

  • Header cells are rendered with column scope and body cells are rendered as table cells.
  • Sortable headers expose aria-sort and can be focused when sorting is enabled.
  • The no-data state uses a status region so updates can be announced.
  • Row selection uses SGDS checkboxes, including the header checkbox for select-all behaviour.
  • Expandable rows render a focusable control cell and fire show and hide lifecycle events.

Labels and content

Clear column headers and concise row content help users understand the relationship between cells.

  • Use short, unique column headers that describe the data in that column.
  • Set sortKey on sortable headers so selected-row and sort events use stable keys.
  • Use the no-data slot to explain empty results and give users a next step.
  • Avoid putting large paragraphs inside table cells. Use expandable row content for supporting details.

Keyboard interaction

KeyInteractionTabMoves focus to sortable headers, row selection checkboxes, expandable row controls, pagination controls, and any row actions added inside cells.EnterSorts focused sortable headers, toggles focused expandable row controls, and activates data table pagination page-number controls.SpaceToggles focused row selection checkboxes and activates native button controls, such as pagination arrows or row action buttons.

Updates

DateVersionDescription24 Sept 2026v3.29.0Add paginationVariant stories and playground demos in #836.17 Sept 2026v3.28.0Remove unintended display:flex from .expandable-content in #827.14 Sept 2026v3.27.0New component in #732.14 Sept 2026v3.27.0Border radius 0 in #822.

Roadmap

Planned itemStatusTargetFuture enhancements for data tablePlannedTBD

Feedback

Have suggestions or feedback?

Share them with us on Slack → #ask-sgds-v3

Bug Reports

Found a bug or issue?

Report it on GitHub Issues → sgds/components/data-table

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2