Skip to main content

The Table component renders a table for displaying and organizing data.

Below, learn how to implement buttons in a UI extension. For guidance on table design, check out the Table design patterns.

To format the table, you can use the following subcomponents:

  • TableHead: the header section of the table containing column labels.
  • TableRow: individual table rows.
  • TableHeader: cells containing bolded column labels.
  • TableBody: container for the main table contents (rows and cells).
  • TableCell: individual cells within the main body.
  • TableFooter: a row at the bottom of the table, typically to summarize the columns.

design-principles-table-with-pagination

PropTypeDescription
borderedBooleanWhen set to false, the table will not include borders. Default is true.
flushBooleanWhen set to true, the table will not include bottom margin. Default is false.
paginatedBooleanWhen set to true, the table will include pagination navigation. Default is false.See the paginated tables section for pagination props.
PropTypeDescription
align'center' | 'left' | 'right'Sets the alignment of a table header.
sortDirection'none' (default) | 'ascending' | 'descending' | 'never'A visual indicator of the current direction in which the column is sorted. Does not modify the table data. See the sortable tables section for more sorting props.
widthNumber | 'min' | 'max' | 'auto'Sets the width of a table header.
  • min: the content will only be as wide as required, overflowing if the content is wider than the table. A horizontal scrollbar will appear when there is overflow.
  • max: the content will expand to occupy the maximum available width without overflowing.
  • auto: the content will adjust its width based on the available space without overflowing.
PropTypeDescription
align'center' | 'left' | 'right'Sets the alignment of a table cell.
widthNumber | 'min' | 'max' | 'auto'Sets the width of a table cell.
  • min: the content will only be as wide as required, overflowing if the content is wider than the table. A horizontal scrollbar will appear when there is overflow.
  • max: the content will expand to occupy the maximum available width without overflowing.
  • auto: the content will adjust its width based on the available space without overflowing.
colSpanNumberSets the number of columns a cell should span.

To include paginated navigation below a table, set the Table prop paginated to true.

table-paginated-navigation

You'll then include the following props to further configure pagination:

PropTypeDescription
maxVisiblePageButtonsNumberThe maximum number of page buttons to display.
pageNumberDenotes the current page number.
pageCountNumberThe total number of pages available.
showButtonLabelsBooleanWhen set to false, hides the text labels for First/Prev/Next buttons. The button labels will still be accessible to screen readers. Default is true.
showFirstLastButtonsBooleanWhen set to true, displays the First/Last page buttons. Default is false.
onPageChange(pagenumber: number) => voidA function that is invoked when the page pagination button is clicked. It receives the new page number as an argument.

To add sorting functionality to a table, you can include the sortDirection and onSortChange props in the table's TableHeader components. To enable table data to dynamically reorder based on user input, you'll need to store your table data in variables rather than hard coding it into table cells. Below is an example of a sortable table with a static table footer.

ui-extensions-sortable-table-1

PropTypeDescription
sortDirection'none' (default) | 'ascending' | 'descending'Visually indicates with an arrow which way the rows are sorted.
onSortChange(value: "none" | "ascending" | "descending") => voidA function that will be invoked when the header is clicked. It receives a sortDirection as an argument (cannot be none or a null value).
disabledBooleanWhen set to true, users cannot change the sort ordering. It has no effect if sortDirection is set to never or undefined. Default is false.
  • A client list containing names, phone numbers, job positions, and email addresses that salespeople can use to prioritize outreach.
  • A summary table of the deals closed last quarter.
  • DO: keep text within data cells clear and concise for easier scanning.
  • DO: always include a table header row to label columns.
  • DO: limit the use of links in table cells.
  • DON'T: use multiple tables on one screen when possible.
  • DON'T: render a blank table if there's no potential for no data to display, such as with search or filters. Instead, use the EmptyState component when there are no results to display.