The Code component renders syntax-highlighted code blocks with an integrated copy-to-clipboard button. It supports multiple languages and themes.
Basic Example
A JavaScript code block with syntax highlighting:
No preview available
Example
Highlighting code...
Properties
Core Properties
- code: The code string to display
- language: Programming language (default: text)
- theme: Color theme — light or dark
Display Options
- showLineNumbers: Show line numbers
- showCopyButton: Show copy button (default: true)
- icons: Custom icons for copy states
- class: Additional CSS classes