Files
newsui/packages/docs/mdx-components.tsx
T
sunzhongyi dd26470754
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled
feat: enable live component rendering in MDX docs
- Register all 24 components in mdx-components.tsx via client boundary
- MDX files can now render real components inline (not just code blocks)
- media.mdx updated with live Figure and PullQuote demos
2026-05-22 10:08:18 +08:00

20 lines
776 B
TypeScript

import type { MDXComponents } from 'mdx/types';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import {
Layout, Section, Article, Layer, Masthead, Rule, Footer,
Headline, Subhead, Kicker, BodyText, Quote, Byline, Dateline, Caption,
Image, Figure, Video, PullQuote,
BreakingNewsBanner, Folio, IndexBox, Factbox, RelatedArticles, AuthorCard,
} from './lib/nui-client';
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
...defaultMdxComponents,
...components,
Layout, Section, Article, Layer, Masthead, Rule, Footer,
Headline, Subhead, Kicker, BodyText, Quote, Byline, Dateline, Caption,
Image, Figure, Video, PullQuote,
BreakingNewsBanner, Folio, IndexBox, Factbox, RelatedArticles, AuthorCard,
};
}