Code Block (Dynamic)
A codeblock that also highlights code
We use cookies
Essential cookies keep the app working. Optional analytics, support, and marketing cookies help us improve the site and services. Cookie Policy.
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
console.log("This is pre-rendered")console.log("This is pre-rendered")