← Back to Components

Code

A premium monospace pre-formatted code block with terminal-style controls and copy actions.

Interactive Playground

R Code

API Reference

block_code()

A premium monospace pre-formatted code block with custom line numbers, copy-to-clipboard button, and optional terminal header.

ArgumentTypeDefaultDescription
codecharacterrequiredThe raw code string to display inside the block.
languagecharacterNULLOptional programming language name displayed in the header.
copyablelogicalTRUEDisplay a copy-to-clipboard action button.
line_numberslogicalTRUEDisplay sequential line numbers in the left margin.
headerlogicalFALSEDisplay macOS window control dots and language header bar.
variant'default' | 'outline''default'Thematic background card styling variant.
classcharacterNULLAdditional custom styling classes to apply.
stylecharacterNULLInline custom CSS styles.