CodeBlock
Read-only code surface with copy support.
Choose CodeBlock for read-only code that readers may need to copy.
Interactive example
Loading interactive example
API
| Member | Type | Kind | Required | Default |
|---|---|---|---|---|
code | string | prop | Yes | |
copyLabel | string | prop | No | 'Copy code' |
copyable | boolean | prop | No | true |
filename | string | prop | No | undefined |
highlight | (code: string, language: string) => string | callback | No | undefined |
label | string | prop | No | undefined |
language | CodeLang | (string & {}) | prop | No | 'text' |
maxHeight | number | prop | No | undefined |
showLineNumbers | boolean | prop | No | false |
wrap | boolean | prop | No | false |
Examples
Source
Loading source