Code Block (Dynamic)
A codeblock that also highlights code
Usage
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock lang="ts" code='console.log("Hello World")' />;Cookie を使用しています
必須 Cookie はアプリの動作に必要です。任意の分析、サポート、マーケティング Cookie は、サイトとサービスの改善に役立ちます。 Cookie ポリシー.
A codeblock that also highlights code
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock lang="ts" code='console.log("Hello World")' />;This component, different from the MDX CodeBlock component, can be used without MDX.
It highlights the code with Shiki and use the default component to render it.
Features:
import { DynamicCodeBlock } from 'fumadocs-ui/components/dynamic-codeblock';
<DynamicCodeBlock
lang="ts"
code='console.log("Hello World")'
options={{
console.log("This is pre-rendered")console.log("This is pre-rendered")