Tables
Search the component library

Tables

v2.0.0
Download UI Kit v1.9.0

Provides standard designs and layouts for tables.

Download UI Kit v1.9.0

Usage Guidelines

Every instance of a basic table should use this component. Pair it with the toolbar component for more advanced use cases.

Features

  • Hoverable rows
  • Responsive guidance
  • Sortable columns
  • Selectable rows

Basic Table

The basic table does what you would expect, presenting data in a static tabular format with headers.

Columns can be left, center, or right aligned.

Multiline cell content should be avoided where possible. Content should be top aligned.

Note that headers are required for accessibility compliance.

Interactive Features

The basic table can be enhanced with some more advanced features to handle more complicated use cases.

Sortable Columns

Clicking on a column heading sorts the table by the values in that column. Selecting the same column heading twice alternates between ascending and descending order.

If a table has a default sort order it should display the relevant icon at initial presentation.

Example of a sortable table showing the header hover state.

Hoverable Rows

If you have a long table a row hover effect can be enabled which makes it easier to scan and parse.

Hovering a row can change its background color.

Selectable Rows

In cases where users may need to select and act on one or more rows you may add a checkbox column and include a toolbar at the top of the table.

Clicking or tapping any non-interactive part of a row is a secondary method for selecting that row (this will also check the relevant checkmark, which is the primary method).

Holding down shift and selecting a second row will select all the intervening rows as well.

Example of a selectable table. Hover effects are enabled by default. (Hovering selected rows adds the border effect.)

Responsive strategies

There are several strategies for ensuring a table works at each breakpoint.

Removing columns

If you determine that certain fields in your table are optional in nature, you can simply remove them to reduce the overall table width until it fits in mobile viewports.

Combining fields

Depending on the type of information presented, a simple way to fit tables into a smaller viewport is combining multiple columns into one. For example, dedicated First and Last name columns can be joined under ‘Name’.

Switching designs

For larger, more complex tables with a lot of non-optional data it may be necessary to change from using a table to some other display strategy in the mobile view. For example, you may adopt a list view where each item can be opened up to view its complete dataset.

Redlines

Basic Table

Header
  • 20px horizontal padding
  • 16px vertical padding
  • Bold UI Text
  • 1px solid Alto border above and below header row
  • Vertically aligned to the center (if a header wraps to two columns)
  • Headers are a non-optional feature of all table types (for accessibility compliance)
Rows
  • 20px horizontal padding
  • 16px vertical padding
  • No lines separating rows
  • 1px solid Alto border following the final row
  • Basic UI Text
  • Vertically align to the top (if a cell wraps to two or more columns)

Sortable Table

Icons
  • Any row that is sortable, but not currently sorted uses the sort-inactive-18 icon
  • Any sorted row should use the sort-down-18 and sort-up-18 icons, depending on the current sort order
Positioning
  • Icons are 8px away from the text, always on the right
  • For right aligned columns, align to the icon
Hover
  • Hovering a sortable column gives the header a moonlight background

Hoverable Row

Background
Cursor
  • Pointer style (Hand with finger)

Selectable Row

Colors
Hovered Colors
Checkmark
  • Checkmark has 20px padding on the left, and uses the standard 20px padding of the cell contents on the right
  • Uses the standard checkmark input
Caption/Controls
  • Any controls or captions which apply to the selected rows should be positioned 28px above or below the main table
  • For example, this could be a toolbar or pagination control
Interaction
  • Any selected row will have an activated checkmark and the selected visual styles
  • Checking the checkbox is the primary selection method
  • Clicking or tapping on any non-interactive part of the row will also put it in a selected state (including checking the checkmark)
  • If a single row is currently selected the user may hold down shift and select another row, causing all intervening rows to also be selected

Changelog

2.0.0

  • CHANGED: Visual style to reflect rebranded aesthetic
  • ADDED: Sortable columns feature
  • ADDED: Selectable row feature
  • REMOVED: Secondary row feature
  • REMOVED: Inline button/input feature
  • REMOVED: Small table feature

1.0.0

Initial Version