Skip to content
mdxcn is now part of Shadcn Labs. details

matrix

GraphMatrix

A grid of exact numbers with labels on both axes. Write a Markdown table. For shaded intensities use Heatmap, and for yes/no features use Compare.

use it
Good when both axes are labels and the cells are exact numbers.
instead
Intensities are Heatmap. Yes/no features are Compare.

detect

[ DETECT ]
PosNeg
  • Pos413
  • Neg254
Matrix with 2 rows and 2 columns
<GraphMatrix title="DETECT" accent="Pos">

| | Pos | Neg |
| --- | --- | --- |
| Pos | 41 | 3 |
| Neg | 2 | 54 |

</GraphMatrix>

install

command

latency

[ P95 ]
iadsfonrt
  • read121841
  • write283367
  • queue469
Matrix with 3 rows and 3 columns
<GraphMatrix title="P95" accent="write">

| | iad | sfo | nrt |
| --- | --- | --- | --- |
| read | 12 | 18 | 41 |
| write | 28 | 33 | 67 |
| queue | 4 | 6 | 9 |

</GraphMatrix>
[ PROPS ]
PropTypeDefaultDescription
titlestring—Caption drawn on the top edge of the frame.
columnsstring[] | "Pos Neg"—Column headings across the top.
rowsMatrixRow[]—label plus one number or string per column. Optional when children are Markdown.
childrenMarkdown—| | Pos | Neg | | --- | --- | --- | | Pos | 41 | 3 |
accentstring—Row label to highlight. Other rows recede.
palette"mono" | "duo" | "multi""mono"mono is one accent plus muted. duo paints the second series with --graph-accent-2. multi cycles three accents.
cornerstring"+"Character at each corner of the frame.
frame"box" | "corners" | "rule" | "none""box"box draws the dashed border. corners keeps only the corner marks. rule draws dashed lines above and below. none drops the border and padding, and puts the title above the content.
classNamestring—Passed to the outer frame.