Marp & Slidev compatibility
astro-slides renders many existing Marp and Slidev decks with little to no editing. Compatibility is handled at the parser level: Slidev directives and Marp shorthand are rewritten into astro-slides’ native model before rendering, so they share the same code path — and the same semantics — as decks authored natively.
Slidev: v-click directives
Section titled “Slidev: v-click directives”Slidev’s click directives are rewritten to astro-slides’ native <Click> / <After> / <Clicks> components before click numbering runs, so they get the exact same step semantics as native reveals. Both the element form and the attribute form are supported.
<!-- Element form --><v-click>Revealed on the first click</v-click><v-after>Revealed with the previous step</v-after>
<v-clicks>
- These list items- reveal together
</v-clicks>
<!-- A value moves to `at` --><v-click="3">Revealed on click 3</v-click>The attribute form wraps any element it’s placed on:
<!-- v-click="+1" becomes <Click at="+1"> around this element --><div v-click="+1">Relative step</div>| Slidev | Maps to |
|---|---|
<v-click> / v-click attr | <Click> |
<v-after> / v-after attr | <After> |
<v-clicks> / v-clicks attr | <Clicks> |
Marp mode
Section titled “Marp mode”Set marp: true in the deck’s headmatter to enable Marp mode. This turns on Marp-specific parsing — directive comments and image shorthand — that is intentionally off for native MDX decks (so an MDX deck that legitimately uses ![bg]-style alt text isn’t affected).
---marp: truetheme: marp-default---
# My Marp deckDirective comments
Section titled “Directive comments”Marp global, local, and scoped directive comments map to slide frontmatter — for example _backgroundColor becomes the slide background, and _class is carried through.
<!-- _class: lead --><!-- _backgroundColor: #101020 -->Image shorthand
Section titled “Image shorthand”In Marp mode, Marp’s image shorthand is rewritten:
 <!-- becomes the slide background --> <!-- background, cover-fit --> <!-- inline <img> with width/height -->Slidev component shims
Section titled “Slidev component shims”A set of Slidev components ship as shims so decks that use them render without edits:
| Component | Behavior |
|---|---|
Youtube | Embeds a YouTube iframe. |
Tweet | Link-card fallback (a live embed isn’t shipped). |
Toc | Renders a table of contents from the slide titles. |
VDrag | Static absolute positioning — honors pos, but interactive drag isn’t supported. |
AutoFitText | Alias of astro-slides’ fit-text primitive. |
LightOrDark | Light/dark named slots, toggled on the color scheme. |
<Youtube id="dQw4w9WgXcQ" />
<Toc />Marp theme ports
Section titled “Marp theme ports”Three Marp themes are ported to astro-slides’ theme-token contract and selectable by name via the theme: headmatter:
marp-defaultmarp-gaiamarp-uncover
---marp: truetheme: marp-gaia---Each theme re-values astro-slides’ --slide-* tokens to approximate the original Marp look. As with all compatibility here, the goal is a faithful feel, not a pixel match.
Source
Section titled “Source”docs/built/15-marp-slidev-compatibility.md— the distilled phase writeup, including the full gap list.packages/core/src/compat/remark-slidev.ts— thev-clickfamily rewriter.packages/parser/src/marp.ts—extractMarpDirectives+extractMarpImages.packages/client/components/{Youtube,Tweet,Toc,VDrag,AutoFitText,LightOrDark}.astro— the Slidev shims.packages/client/src/themes/marp-{default,gaia,uncover}/theme.css— the Marp theme ports.