Table
Examples
Name | Age | Gender | ||
---|---|---|---|---|
Rory Boisvert | 50 | M | ||
Sharon Monroe | 49 | F | ||
Lucy Booth | 18 | F | ||
Usage
Define your data and your columns, and the table will handle the rest.
Do
- Use table for tabular content
- Keep content easy to scan
- Only display data that is relevant to the user flow, without cluttering
- Give columns ample default width to display information
- Always include a header row
- Keep number of decimals consistent throughout
Don't
- Use table for layout purposes only
- Overload the view with too many columns that require excessive horizontal scrolling
- Make columns so narrow that it truncates the information in typical cases
- Center align content or headers
Anatomy
Basic elements

-
Table header row: Header rows are mandatory for all tables, and are always rendered at 40px. For cards with lists without header rows, check the List component.
-
Table row: The table structural row placed at the surface level. Generally, heights are 40px, 48px, 56px, or 64px.
-
Table header cell: Header cells can only include simple labels, and may be interactive to allow sorting.
-
Table cell: An individual cell inside a row. It always preserves a 12px horizontal padding.

-
Card: Tables are always rendered inside card containers, except in legacy pages that don't support cards.
-
Tree chevron: Chevrons are used to expand and collapse trees.
-
Table row padding: Rows have 8px of horizontal padding. No element should be placed in that space.

-
Supporting visual: Visual prefixes are placed in cells and can be icons, persona avatars, and other assets. General sizes are 16px, 24px, and 32px.
-
Unread status: The unread status is used to convey the element is new or was recently changed, and needs attention. Usually the main column gets a bold treatment as well. The unread status tick is not interactive
-
Side actions: Icon buttons, rendered at 32px, are presented vertically centered on mouseover or focus, and get a subtle style on hover

- Checkbox: Checkboxes can be prefixed in rows to allow batch operations. They're always placed at the leftmost corner of the row.
Table cell types
Single-line cell

The most common cell is a single-line label. It is vertically centered in the row, and it ellipsizes by default.
Labels may be rendered in different colors and font familes. $secondary-text may be used for less important cells, monospaced fonts for representing technical references, and semibold for primary cells.
Icons or status visuals may be used prefixed to labels to help identifying the artifact.
Persona avatars and other illustrations may include a bigger supporting visual area at 24px. Rows need to be at least 48px height for using this cell.
Two-line cell

Secondary labels may be included in cells to help identifying the first label. Caution: use a table header that is compatible with all the column information.
Use 32px visual for bigger visuals in 56px-tall rows. Only represent a persona avatar in this size if the person is the primary information of the row.
Tags cell

Cells can include a list of tags. Instead of ellipsis, a fade out is used when space is not sufficient.
Commit cell

Unlike two-line cells with prefixed visuals, commit cells apply a custom element in the secondary label. This makes sure the author is not referenced as the main artifact of the row.
Rows: interactions, side actions, and links

The default state of a row doesn't have any special background. Generally, rows are 40px, 48px, 56px, or 64px tall.
Rows don't change their heights on demand, and don't scale according to the content. If cells don't fit the space, the content either ellipsizes (text), fades out (other custom elements that don't support ellipsis), or adapts its size to fit.
Mouse over

Interactive rows get a mouseover style, highlighting the entire row to inform it is clickable.
Rows that are draggable get a special hint on mouseover.
Selected row

Rows that can be selected always have a checkbox control, allowing the selection to happen.
Selected rows on mouseover get a slightly darker background.
Side actions

Side actions enable direct manipulation of artifacts in tables.
By default, a "more" icon is used to show a context menu with the available options. However, a single secondary action may be represented directly, like the "Remove" action below.
Side action buttons are only visible on hover/focus, and should never represent the main action of the row. E.g. an "Open" action should be triggered only by clicking in the row, and should not be referenced in the context menu.
Single secondary actions may be placed directly in the side action area.
Entire row clickable

For interactive rows, the primary action is activated by clicking in the row. Alternative actions may exist inside the row, like side actions, tree chevrons, checkboxes, or inline links. These actions impede the primary action to be triggered.
Inline links

Labels may have an inline link, letting the user to navigate away from the table.
Tree tables

Hierarchical representations can exist inside tables. Chevrons and spacing help to identify the structure and allow navigation inside the tree.
Chevrons follow the same style behavior as icon buttons.
Drag & drop

Drag & drop is supported in tables, and draggable rows are represented with a special handle on hover.
-
Grab cursor: A draggable row should reserve an area that replaces the cursor to a "grab" mode in the first 16px, in order to enforce the draggable aspect of the row. No extra spacing is required for the cells (they should use the 8px row padding as normal).
-
Previous state: While the user is dragging a row, the row cells get dimmed at 40% opacity. This acts as a small reminder to users where the element was previously.
-
Drop target: A drop target is used to represent where the drop placement will be. For tree tables, the left circle may be placed inset to demonstrate a nested drop.
Sorting

Table supports ordering through interactive header cells. If ordering is supported, one column should be active by default.
-
Hover state: Interactive table header cells get a hover style to identify it is interactive.
-
Cycle through valves: When the user clicks in an interactive table header cell, the ordering cycles first to Descending, and then to Ascending.
-
Focus style: When the user clicks in an interactive table header cell, the ordering cycles first to Descending, and then to Ascending.