Skip to content

Table ​

Structural table chrome for data lists. Compose rows and cells; put content in light DOM with existing Catnip primitives. The table does not own sorting, filtering, selection, or expansion logic.

Overview ​

PieceRole
catnip-tableTable chrome, density M / L, optional striped body rows, optional sticky header
catnip-table-rowBody row chrome: default / hover (neutral/subtler-hover) / selected (primary/subtler) / selected hover (primary/subtler-hover)
catnip-table-cellSlotted cell; header uses table-header + primary/stronger; body uses text-m/l + neutral/strongest

Out of scope for v1 (build in the product): typed cell variants (badge, user, avatar), expandable rows, column filters inside headers, virtualization, column resize. Filters belong above or beside the table (for example catnip-dropdown). Prefer catnip-status for status dots and labels; badges and avatars remain consumer markup until dedicated primitives ship.

Live example ​

Guidelines ​

When to use ​

PatternUse
catnip-table + row + cellTabular data with shared density, hover/selected chrome, and optional sort affordances
Product-built gridVirtualization, column resize, nested expandable rows, editable cells, or a typed cell catalog

Composition rules ​

  1. Place catnip-table-row in the default slot (body) or slot="header". Place catnip-table-cell as direct children of each row.
  2. Parent owns the loop, selection, sort, and filter state — same model as List and Split Button.
  3. Cell content is light-DOM projection. Prefer existing primitives (catnip-checkbox, catnip-link, catnip-button, catnip-icon) over inventing cell type enums.

Selection ​

Bind selected on each body row. Put checkboxes in cells if you need bulk select; the table does not manage a selected-id set.

vue
<catnip-table-row .selected="selectedIds.includes(row.id)">
  <catnip-table-cell>
    <catnip-checkbox
      .modelValue="selectedIds.includes(row.id)"
      .checkboxAriaLabel="'Select ' + row.name"
      @update:modelValue="onToggle(row.id, $event.detail[0])"
    />
  </catnip-table-cell>
  <!-- ... -->
</catnip-table-row>

Sorting ​

Use sortable and activeSort on header cells for UI only — the whole header cell is the hit target. On sort-click, update your sortKey / sortDir (or refetch) and rebind activeSort on the active column only. Do not expect the cell to cycle directions or reorder rows.

Filters ​

Keep filters outside the table header cells — for example a catnip-dropdown toolbar above the table (see the live playground). Do not treat column filters as part of the table API.

Pagination ​

Compose a catnip-pagination below the table; the table has no pagination API. Show it only when the rows span more than one page, and hide it when all rows fit on one page or there are none. See Pagination — Single page and empty results.

Caption and empty state ​

There is no caption or empty slot — compose labelling and empty UI in the product. For the table's name, see Accessibility — What you own.

Empty: when the data set is empty, either render one body row with a message cell, or show a short message below/beside the table. Prefer a simple paragraph; do not invent an empty prop.

vue
<catnip-table table-aria-label="Events">
  <catnip-table-row slot="header">
    <catnip-table-cell header>Event</catnip-table-cell>
    <catnip-table-cell header>Status</catnip-table-cell>
  </catnip-table-row>
  <catnip-table-row v-if="rows.length === 0">
    <catnip-table-cell>No events match your filters.</catnip-table-cell>
  </catnip-table-row>
  <catnip-table-row v-for="row in rows" :key="row.id">
    <!-- ... -->
  </catnip-table-row>
</catnip-table>

More actions ​

Compose a ghost-subtle utility catnip-button in a trailing cell with a consumer-owned catnip-list menu, following the Split Button menu recipe.

Cell content (Figma types → composition) ​

Figma defines many Cell types. Catnip keeps one slotted cell — compose content in light DOM. Do not pass a type prop.

Figma typeHow to compose
TextDefault slot text (body: text-m/l; header: set header)
Numbernumeric + align="end"; header: header + align="end"
LinkSlot catnip-link (optional copy catnip-button / icon beside it)
CheckboxSlot catnip-checkbox; header select-all often align="end"
ExpandSlot icon button (chevron-right) — consumer owns expand state
MoreSlot icon catnip-button (more-horizontal) + consumer catnip-list menu
StatusSlot catnip-status; header filters stay outside the table
BadgeSlot catnip-badge for compact metadata or counts
UserSlot catnip-user
LogoSlot catnip-icon / catnip-graphic

Compact columns (checkbox, expand, more, logo) stay content-width — cells do not force a fixed width.

html
<!-- Number -->
<catnip-table-cell numeric align="end">42</catnip-table-cell>

<!-- Link -->
<catnip-table-cell>
  <catnip-link appearance="underline" right-icon="" href="#">12569HDSU568</catnip-link>
</catnip-table-cell>

<!-- Status -->
<catnip-table-cell>
  <catnip-status intent="success">Active</catnip-status>
</catnip-table-cell>

<!-- Badge -->
<catnip-table-cell>
  <catnip-badge intent="informative">New</catnip-badge>
</catnip-table-cell>

<!-- More -->
<catnip-table-cell>
  <catnip-button appearance="ghost-subtle" purpose="utility" size="s" left-icon="more-horizontal" button-aria-label="More"></catnip-button>
</catnip-table-cell>

Badge and user ​

  • Prefer catnip-status for status dots + labels.
  • Slot catnip-badge for compact metadata or counts.
  • Slot catnip-user for assignee or owner. Leave interaction at the default static in cells that must not imply a menu; use hideName when only the avatar circle should show.

Density and header chrome ​

  • Density is driven by CSS custom properties on catnip-table. Cells inherit those vars — they do not take a size prop.
  • Body type uses --catnip-font-text-m / --catnip-font-text-l; headers use --catnip-font-table-header-m / --catnip-font-table-header-l; numeric uses --catnip-font-code-m / --catnip-font-code-l.
  • Header min height: 48px (M) / 52px (L). Body min height: 40px (M) / 44px (L).
  • Header colour is content/primary/stronger.
  • Cells use space/4 inline padding, space/2 gap, and a neutral/subtlest bottom border.
  • Body row states: default (transparent), hover (neutral/subtler-hover), selected (primary/subtler), and selected hover (primary/subtler-hover).
  • Striped body rows use neutral/subtler. Sortable header cells use neutral/subtler-hover on hover.

Do / don’t ​

  • Do use header on header cells and keep body cells without it.
  • Do keep dense interactive content lightweight; avoid nesting heavy fields in every cell of large tables.
  • Don’t encode product cell types (status, user, badge) as Catnip props.
  • Don’t put multi-select filter panels inside header cells as a DS API.

Catnip Design System by Signicat