Runtime code blocks

Estimated reading time: less than 1 minute

CodeBlockRuntime renders highlighted code dynamically at runtime.

feature-flags.ts
type FeatureFlags = {
docsV2: boolean;
aiSearch: boolean;
adaptiveNav: boolean;
};

const flags: FeatureFlags = {
docsV2: true,
aiSearch: false,
adaptiveNav: true,
};

console.log(flags);

When to use

  • Dynamic examples loaded from runtime data.
  • Cases where static code blocks are not enough.
  • Interactive demonstrations with changing snippets.