Skip to content

Display

Table

Styling and scroll behaviour for a table you write in native markup.

Table
import { Table } from '@anomalia/ui';

Notes

  • Deliberately not a DataTable with column definitions. Column configs are a second, worse templating language: the moment a cell needs two lines, a badge and a link, you are writing render functions inside an array.
  • The wrapper is a focusable labelled region. A scroll container a keyboard user cannot focus is a column they can never reach (SC 2.1.1) — this is the WAI scrollable-region technique, not an accessibility violation.
  • Put data-numeric on a cell to right-align it and switch on tabular figures; data-interactive and data-selected on a <tr> for row states.
  • A sticky head needs an opaque background or the rows scroll through it. That is handled; stickyHead is all you pass.

Examples

Rows

Native table markup, wrapped. `data-numeric` right-aligns a cell and switches on tabular figures; `data-interactive` makes a row hoverable. The wrapper is a focusable labelled region so a keyboard user can reach a column that is off-screen.

Week 35
DayChannelFormatReachRateStatus

Mon

InstagramCarousel42,1805.1% Scheduled

Wed

LinkedInArticle8,9403.8% Needs copy

Fri

InstagramReel96,4027.4% Rendering

Sat

TikTokReel12,0602.2% Draft

API

PropTypeDefaultDescription
labelstringNames the scroll region for keyboard and screen-reader users.
stickyHeadbooleanfalsePins `<thead>` while the body scrolls.
density'comfortable' | 'compact''comfortable'Row padding.
rulesbooleantrueHairlines between rows.

Every component also forwards the native attributes of its root element, plus class, so anything not listed here still works.