gittydocsgittydocs

Type Table

Write an API reference from a manual map of properties and types.

TypeTable renders a manually authored property map, following the Fumadocs-style type API. It is built into .mdx pages—no imports are required. Use it when you want to document an API without reading a TypeScript source file; use Auto Type Table for build-time generation from an interface or type alias.

Live demo

The map keys become property names. Type and default values are display strings, not executable code. Descriptions can include JSX for links, emphasis, and inline code.

Button props
labelRequiredstring
Text shown inside the button.
variant"quiet" | "strong"
Choose the visual treatment. See Theming.
Default
"quiet"
disabledboolean
Prevent interaction without hiding the button.
Default
false
textDeprecatedstring
Use label instead.
button.mdx
<TypeTable
  caption="Button props"
  type={{
    label: {
      type: "string",
      description: <>Text shown inside the button.</>,
      required: true,
    },
    variant: {
      type: '"quiet" | "strong"',
      description: <>Choose the visual treatment. See <a href="/theming">Theming</a>.</>,
      default: '"quiet"',
    },
    disabled: {
      type: "boolean",
      description: <>Prevent interaction without hiding the button.</>,
      default: "false",
    },
    text: {
      type: "string",
      description: <>Use <code>label</code> instead.</>,
      deprecated: true,
    },
  }}
/>

Props

TypeTable props
typeRequiredRecord<string, TypeTableProperty>
Required map of property names to row definitions.
captionstring
Optional visible reference caption and accessible region name. Without it, the region is named “Type reference”.

Row definition

Each value in the type map supports these fields:

TypeTableProperty fields
typeRequiredstring
Required displayed type; write unions, generics, and other notation as strings.
descriptionstring | JSX.Element
Optional description; plain strings and JSX content are supported.
defaultstring
Optional displayed default. When omitted, the Default line is hidden.
requiredboolean
Show a “Required” badge when true.
Default
false
deprecatedboolean
Show a “Deprecated” badge when true.
Default
false

The compact summary shows the Prop and Type. Expand a row to read its description and default. Row definitions do not infer whether a property is optional or deprecated: set the badges explicitly. A default documents a value; it does not change the behavior of the API you are describing.

Rows use native disclosures: focus a summary and press Enter or Space to toggle it. Expansion and collapse use the same animation as accordions and respect reduced motion. On narrow screens, the type wraps beneath the property name rather than forcing horizontal scrolling. The rounded container has a muted background and subtle border; closely spaced rows blend into it when collapsed and show a border only when open.