mdx-components Registry #

File: components/mdx-components.js

This registry maps imported React components to MDX tags.

Responsibilities #

  • Exposes components like Alert, Card, Infobox, and WikiTable primitives.
  • Exposes components like Alert, Card, Infobox, BarChart, MathEquation, PeriodicTable, Quiz, Poll, and Flashcards.
  • Overrides markdown element renderers (pre, table, thead, tbody, tr, th, td, caption).
  • Defines what can be used directly inside .mdx content.

When to update #

  • After adding a new component intended for MDX pages.
  • When changing global markdown element rendering behavior.

Live examples of registry mappings #

The examples below are rendered through the registry:

Mapped component

Alert is available directly in MDX without manual import.

Callout and Icon are also mapped globally.

MappingResult
preUses CodeBlock
tableUses WikiTable.Table
th / tdUses WikiTable.TH / WikiTable.TD
BarChart / SparklineChart / DonutChart / AreaChart / StackedBarChartUses chart components from components/charts/
HeatmapChart / ProgressRingChartAdditional chart components from components/charts/
MathEquation / FormulaList / MathSteps / UnitConverterUses math components from components/math/
PeriodicTable / ElementCard / CompoundBreakdownUses science components from components/science/
Quiz / Poll / FlashcardsUses interactive components from components/interactive/