Every row against every column at a glance, each cell a status glyph named with where it is and why.
<div id="sm-grid" data-mount="grid"></div>
Copy
Installation
HTML and CSS React
// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";
import "capsomer/status-matrix.css";Copy
import "capsomer/tokens.css";
import "capsomer/status-matrix.css";
import { StatusMatrix, MatrixKey } from "capsomer/react/status-matrix";Copy
Usage
import { MatrixKey, StatusMatrix } from "capsomer/react/status-matrix";
<StatusMatrix
caption="Completeness by area and site"
columns={sites.map((s) => ({ id: s.id, name: s.name }))}
rows={areas.map((a) => ({
id: a.id,
name: <Link to={`#${a.id}`}>{a.name}</Link>,
text: a.name,
cells: Object.fromEntries(Object.entries(a.cells).map(([id, c]) => [id, { tone: TONE[c.status], label: LABEL[c.status], reason: c.reason }])),
}))}
/>Copy
API reference
StatusMatrix Prop Type Required Does captionstringYes showCaptionbooleancolumnsMatrixColumn[]Yes rowsMatrixRow[]Yes emptyLabelstringA cell with no status: not checked, or not applicable. Read as these words.
MatrixKey Prop Type Required Does itemsArray<{ tone: Tone; glyph?: GlyphName; label: string }>Yes
Parts and data attributes Class Is .cap-matrixthe root .cap-matrix-keya part .cap-matrix-marka part .cap-matrix-nonea part
Accessibility
A real table: column headers, row headers, and each cell's image named with both, so a screen reader moving by cell hears where it is. The scroll box is a named region with tabindex="0".