Code Block
Syntax-highlighted via Astro’s built-in <Code> component (Shiki), so no
extra highlighting library is needed. Takes the code as a code string
prop rather than slotted children, which keeps the highlighter’s real
output (not our own markup) in the <pre>.
Button.astro
---
import Button from "@samla/ui/Button.astro";
---
<Button href="/work/">See our work</Button>Options
Section titled “Options”code: required, the code to highlightfilename: optional, shown in the headerlang: optional Shiki language id, e.g.astro,css,bash(defaultplaintext)lineNumbers: booleancopy: boolean, adds the copy button
<CodeBlock filename="Button.astro" lang="astro" copy lineNumbers code={`<Button href="/work/">See our work</Button>`}/>