| name | slidev |
| description | Create and present web-based slides for developers using Markdown, Vue components, code highlighting, animations, and interactive features. Use when building technical presentations, conference talks, or teaching materials. |
Slidev - Presentation Slides for Developers
Web-based slides maker built on Vite, Vue, and Markdown.
When to Use
- Technical presentations with live code examples
- Syntax-highlighted code snippets with animations
- Interactive demos (Monaco editor, runnable code)
- Mathematical equations (LaTeX) or diagrams (Mermaid, PlantUML)
- Record presentations with presenter notes
- Export to PDF, PPTX, or host as SPA
Quick Start
pnpm create slidev
pnpm run dev
pnpm run export
Basic Syntax
---
theme: default
title: My Presentation
---
# First Slide
Content here
---
# Second Slide
More content
<!--
Presenter notes go here
-->
--- separates slides
- First frontmatter = headmatter (deck config)
- HTML comments = presenter notes
Core References
| Topic | Description | Reference |
|---|
| Markdown Syntax | Slide separators, frontmatter, notes, code blocks | core-syntax |
| Animations | v-click, v-clicks, motion, transitions | core-animations |
| Headmatter | Deck-wide configuration options | core-headmatter |
| Frontmatter | Per-slide configuration options | core-frontmatter |
| CLI Commands | Dev, build, export, theme commands | core-cli |
| Components | Built-in Vue components | core-components |
| Layouts | Built-in slide layouts | core-layouts |
| Exporting | PDF, PPTX, PNG export options | core-exporting |
| Hosting | Build and deploy to various platforms | core-hosting |
| Global Context | $nav, $slidev, composables API | core-global-context |
Feature Reference
Code & Editor
Diagrams & Math
Layout & Styling
Animation & Interaction
Syntax Extensions
Presenter & Recording
Export & Build
Editor & Tools
Lifecycle & API
Common Layouts
| Layout | Purpose |
|---|
cover | Title/cover slide |
center | Centered content |
default | Standard slide |
two-cols | Two columns (use ::right::) |
two-cols-header | Header + two columns |
image / image-left / image-right | Image layouts |
iframe / iframe-left / iframe-right | Embed URLs |
quote | Quotation |
section | Section divider |
fact / statement | Data/statement display |
intro / end | Intro/end slides |
Custom Interactive Diagram Components
This project includes hand-drawn SVG diagram components in packages/slidev-addon-utils/components/ that use roughjs for a sketch aesthetic and integrate with Slidev's click system for progressive reveal.
Available Components
| Component | Purpose | File |
|---|
Timeline | Horizontal timeline with milestones, dots, connectors, and detail text | components/Timeline.vue |
FlowDiagram | Flow chart with nodes and edges | components/FlowDiagram.vue |
PyramidOutline | Layered pyramid diagram | components/PyramidOutline.vue |
SplitDiagram | Side-by-side comparison diagram | components/SplitDiagram.vue |
Click Integration Pattern
All diagram components use useSlideContext() to access $clicks and reveal items progressively. Each item has an optional click property — if set, the item is hidden until $clicks >= click.
Important: When using click-based reveals, set the slide's clicks frontmatter to max click value + 1. Slidev treats the final click as navigation to the next slide, so you need one extra click to keep the last item visible.
---
clicks: 5 # Items use click: 1–4, so set clicks to 5
layout: center
---
<Timeline
:items="[
{ id: 'a', title: 'First', click: 1 },
{ id: 'b', title: 'Second', click: 2 },
{ id: 'c', title: 'Third', click: 3 },
{ id: 'd', title: 'Fourth', click: 4 },
]"
/>
Timeline Component Props
| Prop | Type | Default | Description |
|---|
items | TimelineItem[] | required | Array of milestone items |
roughness | number | 1.5 | Roughjs sketch roughness |
seed | number | 42 | Roughjs random seed for consistent rendering |
dotRadius | number | 8 | Radius of milestone dots |
gap | number | 200 | Horizontal spacing between milestones |
TimelineItem Shape
interface TimelineItem {
id: string
title: string
year?: string
description?: string
details?: string[]
click?: number
variant?: 'default' | 'accent' | 'muted' | 'success'
}
Tips
- Use
layout: center with class: flex items-center justify-center h-full for full-slide diagrams with no other text
- Start click values at 1 (not 0) so the slide initially shows only the base diagram (e.g. the timeline arrow)
- The
variant prop controls color theming per item (pink accent, green success, dimmed muted)
Resources