Compare records
Use data tables when each row shares the same set of fields.
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.
Use data tables when each row shares the same set of fields.
Built-in pagination helps users move through many records.
Support sorting, selection, and expandable details where needed.
Header row
Data row
Expanded panel
Footer (optional)
Expand indicator
Checkbox
Header cell
Sorting (optional)
Configure header cells with supported sgds-data-table-head props.
Set sorting and sortKey on headers that should sort rows.
Use supported sgds-data-table-row props for expandable row details.
Set expand on rows that reveal detail content.
Use multiSelect on the table and checked on rows for selection states.
Set multiSelect to render a checkbox column for row selection.
Configure result count, items per page, summary text, and pagination variant.
Use currentPage, dataLength, and itemsPerPage for default pagination.
Choose client or server pagination, and use serverSort when an API handles sorting.
Default. Client mode slices slotted rows and handles local sorting.
Use the built-in loading and no-data states shown in Storybook.
With no body rows, the table shows the default no-data state.
Choose how the browser sizes columns inside the data table.
Default. Use layout="auto" to let content influence column sizing.
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.
sgds-padding-sm—sgds-padding-md16pxsgds-padding-lg20pxsgds-padding-2-xl32pxsgds-padding-4-xl—sgds-gap-2-xs4pxsgds-border-width-11pxsgds-border-radius-none—sgds-form-border-radius-sm—sgds-font-family-brand—sgds-font-size-label-sm—sgds-font-weight-semibold—sgds-font-weight-regular—sgds-line-height-2-xsHeight variessgds-letter-spacing-normal—sgds-outline-focus—sgds-outline-offset-focus—Use a data table when records need built-in behaviours such as sorting, pagination, selection, loading states, or expandable row details.
If the content is already prepared and does not need built-in data management features, use a table instead.
Set sorting and sortKey only on columns users can compare. This gives client sorting and server sort events a stable field name.
Keep sorting to data columns. Action and control columns should not emit sort events.
Set loading while rows are being fetched, and use the no-data slot when the current query returns no records.
For attributes of a single item, a description list shows the label-value relationship more clearly.
Data table renders table semantics from composed SGDS row, header, and cell elements.
aria-sort and can be focused when sorting is enabled.Clear column headers and concise row content help users understand the relationship between cells.
sortKey on sortable headers so selected-row and sort events use stable keys.no-data slot to explain empty results and give users a next step.TabEnterSpaceShare them with us on Slack → #ask-sgds-v3
Report it on GitHub Issues → sgds/components/data-table
The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.