is:raw

The is:raw directive tells Astro to treat an element's children as plain text, skipping all processing.

Since Astro 1.0 Spec ↗

Syntax

<pre is:raw>{`{{ mustache }}`}</pre>

Examples

<pre is:raw>
---
const x = { a: 1 };
console.log(`value: ${x.a}`);
---
</pre>
Output
Renders the Astro-like code sample verbatim without interpreting the frontmatter fences or template literals.

Notes

Useful for code samples, documentation, or templating syntax that would otherwise be parsed as Astro expressions or components. Children are emitted exactly as written.

See also