Welcome to Zudoku preview! Open a GitHub issue if you have feature requests or find any issues.
Zudoku
Components

Syntax Highlight

It is used to highlight code blocks in your content.

You can also use backticks to highlight code blocks in Markdown files, see Code Blocks for more information.

Types

Code(ts)
type SyntaxHighlightProps = { language?: string; code?: string; wrapLines?: boolean; title?: string; showCopy?: "hover" | "always" | "never"; showCopyText?: boolean; children?: string; showLanguageIndicator?: boolean; noBackground?: boolean; className?: string; showLineNumbers?: boolean; };

Usage

You can either use children or code prop to pass the code to the component.

Code(tsx)
<SyntaxHighlight language="typescript"> {`for (let i = 0; i < Infinity; i++) { console.log(i); }`} </SyntaxHighlight>

Result

Code
for (let i = 0; i < Infinity; i++) {
  console.log(i);
}
Last modified on