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#
| Name | Type | Default | Description |
|---|---|---|---|
title* | string | - | Page title shown in the sidebar and as the h1. |
description | string | - | One-line summary under the title. |
full | boolean | false | Hide the right-hand TOC and span the full width. |
<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#
| Name | Type | Default | Description |
|---|---|---|---|
type* | Record<string, TypeTableEntry> | - | Property name to its definition. |
className | string | - | Extra class on the wrapper. |
TypeTableEntry#
| Name | Type | Default | Description |
|---|---|---|---|
type* | string | - | Type as it should be displayed, for example "string | number". |
description | ReactNode | - | Explanation shown under the name. |
default | string | - | Default value, displayed verbatim. |
required | boolean | false | Marks the property as required. |
Importing outside MDX#
import { TypeTable } from "pzzadocs/mdx";
<TypeTable type={{ id: { type: "string", required: true } }} />