← 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.
| Argument | Type | Default | Description |
|---|---|---|---|
| code | character | required | The raw code string to display inside the block. |
| language | character | NULL | Optional programming language name displayed in the header. |
| copyable | logical | TRUE | Display a copy-to-clipboard action button. |
| line_numbers | logical | TRUE | Display sequential line numbers in the left margin. |
| header | logical | FALSE | Display macOS window control dots and language header bar. |
| variant | 'default' | 'outline' | 'default' | Thematic background card styling variant. |
| class | character | NULL | Additional custom styling classes to apply. |
| style | character | NULL | Inline custom CSS styles. |