<cad-code-block>
Code block
Display code with syntax colors, optional line numbers, and a copy button.
Selective component imports
API reference: <cad-code-block>
Copying
Add copyable for the built-in copy button. cad-code-copy reports success or failure. Use the actions slot for custom controls.
Syntax colors
HTML, Astro, JavaScript, TypeScript, CSS, JSON, and shell have built-in syntax colors. Other languages display as plain text. For a different highlighter, place pre-highlighted markup in the default slot.