Patterns · DocumentationDocs only

Docs table

The docs table shows rows of comparable data. It sits in a wrap with the elevation of a dashboard card and scrolls sideways when the window is narrow.

Every example on this page is the real component, not a picture.

Playground

A table in its wrap. The wrap carries the card shadow and scrolls sideways when the window is too narrow. Pick one header tone per page.

Cells
Rows

Markup for this selection

HTML

Variants

Text columns are left-aligned. Check-icon columns are centered on the docs pages (page-local).

Text

Check icons

Read-only eco-checkbox in a .check-icon cell.

Wide content scrolls

The table keeps its width; the wrap scrolls and the page does not.

Specs

Dimensions

PartValue
Header row56px (a minimum: taller if the text wraps)
Body row48px (a minimum)
Cell padding11px top and bottom, 24px left and right. The 1px line makes it 12px; keeps a one-line row at 48px
WrapNo border, overflow-x: auto

Type

Header cells and the first column (row header) are bold (600). Body cells are body-sm: 14/20, 0.36px. The same on every breakpoint.

Tokens

Resolved from the live token package.

StatePartTokenValue

Header background

ToneTokenWhen
Defaultsurface-02Standard
Accentaccent-lightMore emphasis, Swedol accent. For Tools: --color-primitive-color-brand-tools-accent-light (a primitive)
Statussurface-{information, success, warning, danger}-weakerOnly when the table itself carries that status

Pick one per page; never mix tones in one table. Header text stays text-primary.

Open points: the values come from the docs pages, not from a Figma component. Not built yet: sorting, selection, sticky header, empty and loading states, dark mode, very long cell text, and rows with a control other than a checkbox. The 11px padding is a consequence of the 1px row line.

Accessibility

TopicRule
MarkupReal th with scope; name the table with a caption or a nearby heading.
Last rowNo bottom line. Scope the rule to tbody, never a bare tr:last-child (it removes a one-row header’s line).
Narrow windowThe wrap scrolls; the page does not (scrollWidth == innerWidth).

Code

CSS (components/css/table.css)

Usage

The data…Use
has rows and columns to compareTable
is one list of label and value pairsA description list
is a layoutCSS grid, never a table

Do

  • Use th with scope.
  • Keep one header tone per page.
  • Bold the first column as the row header.
  • Check that the wrap scrolls at 375px.

Don’t

  • Use a table for layout.
  • Add a bottom line on the last row.
  • Mix header tones in one table.
  • Hardcode colors, shadow or spacing.