npx skills add https://github.com/antfu/skills --skill slidev基于 Vite、Vue 和 Markdown 构建的网页幻灯片制作工具。
pnpm create slidev # 创建项目
pnpm run dev # 启动开发服务器
pnpm run export # 导出为 PDF
---
theme: default
title: My Presentation
---
# 第一张幻灯片
内容在此
---
# 第二张幻灯片
更多内容
<!--
演讲者备注写在这里
-->
--- 分隔幻灯片| 主题 | 描述 | 参考链接 |
|---|---|---|
| Markdown 语法 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 幻灯片分隔符、frontmatter、备注、代码块 |
| core-syntax |
| 动画 | v-click, v-clicks, motion, transitions | core-animations |
| Headmatter | 整个演示文稿的配置选项 | core-headmatter |
| Frontmatter | 每张幻灯片的配置选项 | core-frontmatter |
| CLI 命令 | 开发、构建、导出、主题命令 | core-cli |
| 组件 | 内置 Vue 组件 | core-components |
| 布局 | 内置幻灯片布局 | core-layouts |
| 导出 | PDF、PPTX、PNG 导出选项 | core-exporting |
| 托管 | 构建并部署到各种平台 | core-hosting |
| 全局上下文 | $nav, $slidev, composables API | core-global-context |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 行高亮 | ````ts {2,3}` | code-line-highlighting |
| 基于点击的高亮 | ````ts {1 | 2-3 |
| 行号 | lineNumbers: true 或 {lines:true} | code-line-numbers |
| 可滚动代码 | {maxHeight:'100px'} | code-max-height |
| 代码标签页 | ::code-group (需要 mdc: true) | code-groups |
| Monaco 编辑器 | ````ts {monaco}` | editor-monaco |
| 运行代码 | ````ts {monaco-run}` | editor-monaco-run |
| 编辑文件 | <<< ./file.ts {monaco-write} | editor-monaco-write |
| 代码动画 | `````md magic-move` | code-magic-move |
| TypeScript 类型 | ````ts twoslash` | code-twoslash |
| 导入代码 | <<< @/snippets/file.js | code-import-snippet |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| Mermaid 图表 | ````mermaid` | diagram-mermaid |
| PlantUML 图表 | ````plantuml` | diagram-plantuml |
| LaTeX 数学公式 | $inline$ 或 $$block$$ | diagram-latex |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 画布尺寸 | canvasWidth, aspectRatio | layout-canvas-size |
| 缩放幻灯片 | zoom: 0.8 | layout-zoom |
| 缩放元素 | <Transform :scale="0.5"> | layout-transform |
| 布局插槽 | ::right::, ::default:: | layout-slots |
| 作用域 CSS | 在幻灯片中使用 <style> | style-scoped |
| 全局层 | global-top.vue, global-bottom.vue | layout-global-layers |
| 可拖拽元素 | v-drag, <v-drag> | layout-draggable |
| 图标 | <mdi-icon-name /> | style-icons |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 点击动画 | v-click, <v-clicks> | core-animations |
| 手绘标记 | v-mark.underline, v-mark.circle | animation-rough-marker |
| 绘图模式 | 按 C 键或配置 drawings: | animation-drawing |
| 方向样式 | forward:delay-300 | style-direction |
| 备注高亮 | 在备注中使用 [click] | animation-click-marker |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| MDC 语法 | mdc: true + {style="color:red"} | syntax-mdc |
| 块级 frontmatter | ````yaml替代---` | syntax-block-frontmatter |
| 导入幻灯片 | src: ./other.md | syntax-importing-slides |
| 合并 frontmatter | 主入口优先 | syntax-frontmatter-merging |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 录制 | 按 G 键开启摄像头 | presenter-recording |
| 计时器 | duration: 30min, timer: countdown | presenter-timer |
| 远程控制 | slidev --remote | presenter-remote |
| 注音文本 | notesAutoRuby: | presenter-notes-ruby |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 导出选项 | slidev export | core-exporting |
| 构建与部署 | slidev build | core-hosting |
| 构建时包含 PDF | download: true | build-pdf |
| 缓存图片 | 对远程 URL 自动缓存 | build-remote-assets |
| OG 图片 | seoMeta.ogImage 或 og-image.png | build-og-image |
| SEO 标签 | seoMeta: | build-seo-meta |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 侧边编辑器 | 点击编辑图标 | editor-side |
| VS Code 扩展 | 安装 antfu.slidev | editor-vscode |
| Prettier | prettier-plugin-slidev | editor-prettier |
| 弹出主题 | slidev theme eject | tool-eject-theme |
| 功能 | 用法 | 参考链接 |
|---|---|---|
| 幻灯片钩子 | onSlideEnter(), onSlideLeave() | api-slide-hooks |
| 导航 API | $nav, useNav() | core-global-context |
| 布局 | 用途 |
|---|---|
cover | 标题/封面幻灯片 |
center | 居中内容 |
default | 标准幻灯片 |
two-cols | 两列布局(使用 ::right::) |
two-cols-header | 标题 + 两列布局 |
image / image-left / image-right | 图片布局 |
iframe / iframe-left / iframe-right | 嵌入 URL |
quote | 引用 |
section | 章节分隔 |
fact / statement | 数据/声明展示 |
intro / end | 开场/结束幻灯片 |
每周安装量
3.4K
代码仓库
GitHub 星标
3.9K
首次出现
2026 年 1 月 28 日
安全审计
安装于
opencode2.7K
codex2.6K
gemini-cli2.5K
github-copilot2.4K
cursor2.4K
claude-code2.3K
Web-based slides maker built on Vite, Vue, and Markdown.
pnpm create slidev # Create project
pnpm run dev # Start dev server
pnpm run export # Export to PDF
---
theme: default
title: My Presentation
---
# First Slide
Content here
---
# Second Slide
More content
<!--
Presenter notes go here
-->
--- separates slides| 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 |
| Feature | Usage | Reference |
|---|---|---|
| Line highlighting | ````ts {2,3}` | code-line-highlighting |
| Click-based highlighting | ````ts {1 | 2-3 |
| Line numbers | lineNumbers: true or {lines:true} | code-line-numbers |
| Scrollable code | {maxHeight:'100px'} | code-max-height |
| Code tabs | (requires ) |
| Feature | Usage | Reference |
|---|---|---|
| Mermaid diagrams | ````mermaid` | diagram-mermaid |
| PlantUML diagrams | ````plantuml` | diagram-plantuml |
| LaTeX math | $inline$ or $$block$$ | diagram-latex |
| Feature | Usage | Reference |
|---|---|---|
| Canvas size | canvasWidth, aspectRatio | layout-canvas-size |
| Zoom slide | zoom: 0.8 | layout-zoom |
| Scale elements | <Transform :scale="0.5"> | layout-transform |
| Layout slots | ::right::, |
| Feature | Usage | Reference |
|---|---|---|
| Click animations | v-click, <v-clicks> | core-animations |
| Rough markers | v-mark.underline, v-mark.circle | animation-rough-marker |
| Drawing mode | Press C or config drawings: |
| Feature | Usage | Reference |
|---|---|---|
| MDC syntax | mdc: true + {style="color:red"} | syntax-mdc |
| Block frontmatter | ````yamlinstead of---` | syntax-block-frontmatter |
| Import slides | src: ./other.md | syntax-importing-slides |
| Merge frontmatter | Main entry wins |
| Feature | Usage | Reference |
|---|---|---|
| Recording | Press G for camera | presenter-recording |
| Timer | duration: 30min, timer: countdown | presenter-timer |
| Remote control | slidev --remote | presenter-remote |
| Ruby text | notesAutoRuby: |
| Feature | Usage | Reference |
|---|---|---|
| Export options | slidev export | core-exporting |
| Build & deploy | slidev build | core-hosting |
| Build with PDF | download: true | build-pdf |
| Cache images | Automatic for remote URLs | build-remote-assets |
| Feature | Usage | Reference |
|---|---|---|
| Side editor | Click edit icon | editor-side |
| VS Code extension | Install antfu.slidev | editor-vscode |
| Prettier | prettier-plugin-slidev | editor-prettier |
| Eject theme | slidev theme eject | tool-eject-theme |
| Feature | Usage | Reference |
|---|---|---|
| Slide hooks | onSlideEnter(), onSlideLeave() | api-slide-hooks |
| Navigation API | $nav, useNav() | core-global-context |
| 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 / / |
Weekly Installs
3.4K
Repository
GitHub Stars
3.9K
First Seen
Jan 28, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode2.7K
codex2.6K
gemini-cli2.5K
github-copilot2.4K
cursor2.4K
claude-code2.3K
97,600 周安装
| 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 |
::code-groupmdc: true| code-groups |
| Monaco editor | ````ts {monaco}` | editor-monaco |
| Run code | ````ts {monaco-run}` | editor-monaco-run |
| Edit files | <<< ./file.ts {monaco-write} | editor-monaco-write |
| Code animations | `````md magic-move` | code-magic-move |
| TypeScript types | ````ts twoslash` | code-twoslash |
| Import code | <<< @/snippets/file.js | code-import-snippet |
::default::| layout-slots |
| Scoped CSS | <style> in slide | style-scoped |
| Global layers | global-top.vue, global-bottom.vue | layout-global-layers |
| Draggable elements | v-drag, <v-drag> | layout-draggable |
| Icons | <mdi-icon-name /> | style-icons |
| animation-drawing |
| Direction styles | forward:delay-300 | style-direction |
| Note highlighting | [click] in notes | animation-click-marker |
| syntax-frontmatter-merging |
| presenter-notes-ruby |
| OG image |
seoMeta.ogImage or og-image.png |
| build-og-image |
| SEO tags | seoMeta: | build-seo-meta |
image-leftimage-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 |