Code Blocks
Markdown code block
Section titled “Markdown code block”Code block rendered with the Markdown syntax using three backticks ```
at the start and end.
const foo = 'bar'
<Code>
component
Section titled “<Code> component”Code block rendered with the <Code>
component.
const foo = 'bar'
Text markers
Section titled “Text markers”Code blocks with some text markers.
function test() { const foo = 'bar'}
function test() { const foo = 'bar'}
Labels
Section titled “Labels”Code blocks with some text markers and labels.
---import { Icon } from '@astrojs/starlight/components';---
<Icon name="seti:lock" />
<button type="button">Login</button>
<a href="/login/">Login</a>
Code block combining syntax highlighting with diff
-like syntax.
function test() { const foo = 'bar' const foo = 'baz'}
Editor frame
Section titled “Editor frame”Code block with a file name in the editor frame.
const foo = 'bar'
Terminal frame
Section titled “Terminal frame”Code block with a terminal frame.
pnpm run build