Type Table

A props or options reference table with name, type, default, and description.

TypeTable renders a reference table for an object's properties. It is the fastest way to document component props, config fields, or API options without hand-writing a Markdown table, and it is what most reference tables on this site use.

Usage#

NameTypeDefaultDescription
title*string-Page title shown in the sidebar and as the h1.
descriptionstring-One-line summary under the title.
fullbooleanfalseHide the right-hand TOC and span the full width.
mdx
<TypeTable
  type={{
    title: { type: "string", required: true, description: "Page title shown in the sidebar and as the h1." },
    description: { type: "string", description: "One-line summary under the title." },
    full: { type: "boolean", default: "false", description: "Hide the right-hand TOC and span the full width." },
  }}
/>

Keys are rendered in insertion order. Required entries are marked next to the name, and the description can contain any React node, so inline code and links work.

Props#

NameTypeDefaultDescription
type*Record<string, TypeTableEntry>-Property name to its definition.
classNamestring-Extra class on the wrapper.

TypeTableEntry#

NameTypeDefaultDescription
type*string-Type as it should be displayed, for example "string | number".
descriptionReactNode-Explanation shown under the name.
defaultstring-Default value, displayed verbatim.
requiredbooleanfalseMarks the property as required.

Importing outside MDX#

tsx
import { TypeTable } from "pzzadocs/mdx";

<TypeTable type={{ id: { type: "string", required: true } }} />