Component reference
Preact component props documentation with @preactpress/plugin-component-reference
Component reference#
Document Preact component props with static TypeScript extraction:
<ComponentReference component="Button" />
Or with explicit source:
<ComponentReference source="../../src/components/Button.tsx" exportName="Button" />
Register MDX components in your theme:
import { createComponentReferenceComponents } from "@preactpress/plugin-component-reference/mdx";
import manifest from "../../.preactpress/component-manifest.json";
import "@preactpress/plugin-component-reference/style.css";
const mdxComponents = {
...createMdxHeadingComponents(...),
...createComponentReferenceComponents(manifest),
};
See the package README.