Tessera
GitHub

Data display

CodeBlock

Multi-line code with a copy button. Use for API payloads, configuration and logs.

When to use

Multi-line code, payloads, configuration or logs with a copy button.

Use something else

One value in a sentence → CodeInline.

Do

  • Set title or language; turn on lineNumbers for longer snippets.

Don't

  • Don't wrap long lines; let them scroll.

Props

PropType
code requiredstring
titlestring
languagestring
lineNumbersboolean

Use

const { CodeBlock } = window.Tessera;
const el = React.createElement(CodeBlock, { /* props */ });