Installation
Quick Start
MDX Integration
Use as a remark plugin to automatically generate type tables in your MDX files:source.config.ts
Usage in MDX
Given a TypeScript file:lib/types.ts
docs/components/button.mdx
Add TypeTable Component
Make sure to include theTypeTable component in your MDX components:
mdx-components.tsx
UI Component
You can also use theAutoTypeTable component directly in React Server Components:
app/docs/api/page.tsx
Generator API
Creating a Generator
Generate Documentation
Generate Type Table
JSDoc Annotations
Hide Internal Properties
Use@internal to hide properties from documentation:
_cache property won’t appear in generated documentation.
Simplified Type Display
Use@remarks to show a simplified type name:
timestamp instead of number, and User instead of the full object type.
Custom Type Display
Use@fumadocsType to override the full type:
Link Types
Use@fumadocsHref to link to other documentation:
Default Values
Use@defaultValue to document defaults:
Function Parameters
Document function parameters with@param:
Return Values
Document return values with@returns:
Deprecation
Mark properties as deprecated:Advanced Usage
Custom Transformers
Transform documentation entries before rendering:Caching
Use file system caching to improve build performance:Custom Rendering
Customize how types and markdown are rendered:Syntax Highlighting
Configure Shiki for code highlighting:Component Examples
React Component Props
components/card.tsx
docs/components/card.mdx
Configuration Objects
lib/config.ts
API Response Types
lib/api-types.ts
Best Practices
- Write comprehensive JSDoc: Include descriptions for all public types and properties
- Use @remarks for context: Provide additional information about complex types
- Mark internal APIs: Use
@internalto hide implementation details - Enable caching: Use file system cache in development and production builds
- Link related types: Use
@fumadocsHrefto connect documentation sections - Document defaults: Always specify
@defaultValuefor optional properties - Organize types: Keep related types in the same file for easier documentation
TypeScript Configuration
Ensure yourtsconfig.json is properly configured:
tsconfig.json