CodeBlock

Usage

<CodeBlock
  code={string}
  language?={string}
  title?={string}
  lineNumbers?={boolean}
  highlightLines?={number[]}
>
  {children}
</CodeBlock>

Props

PropTypeRequiredDescription
codestringYesThe code to display
languagestringNoProgramming language for syntax highlighting
titlestringNoOptional title shown above the code
lineNumbersbooleanNoShow line numbers
highlightLinesnumber[]NoLine numbers to highlight
childrenReactNodeNoOptional custom content to render instead of the code

Source


← ApiSignature | CodeGroup →