重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
slidev-layouts by yoanbernabeu/slidev-skills
npx skills add https://github.com/yoanbernabeu/slidev-skills --skill slidev-layouts此技能涵盖所有内置的 Slidev 布局,并教你如何针对不同类型的内容有效地使用它们。你还将学习如何创建自定义布局。
在幻灯片的 Frontmatter 中指定布局:
---
layout: center
---
# 居中内容
适用于一般内容的基本布局。
---
layout: default
---
# 默认布局
任何内容都适用:
- 列表
- 代码块
- 图片
- 表格
在水平和垂直方向上都居中内容。
---
layout: center
---
# 重要声明
非常适合有影响力的单一信息
最佳用于:引用、关键要点、章节标题
带有醒目标题显示的起始幻灯片。
---
layout: cover
background: /images/cover.jpg
---
# 演示文稿标题
副标题或作者姓名
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
选项:
background: 图片 URL 或颜色最佳用于:第一张幻灯片、章节起始页
包含作者/演讲者信息的介绍幻灯片。
---
layout: intro
---
# 我的演示文稿
## 代码之旅
<div class="absolute bottom-10">
<span class="font-700">
John Doe
</span>
<br>
<span class="text-sm opacity-50">
TechCorp 高级开发人员
</span>
</div>
标记新章节的开始。
---
layout: section
---
# 第一部分
入门指南
最佳用于:将演示文稿划分为逻辑章节
强调单个陈述或引用。
---
layout: statement
---
# 代码即诗
最佳用于:有力的引用、关键信息
显示带有出处的引用。
---
layout: quote
---
# "任何傻瓜都能写出计算机能理解的代码。优秀的程序员能写出人类能理解的代码。"
Martin Fowler
突出重要事实或统计数据。
---
layout: fact
---
# 100%
的开发人员喜欢 Slidev*
<small>*需要引用来源</small>
最佳用于:统计数据、数字、关键事实
包含左/右内容的两列布局。
---
layout: two-cols
---
# 左列
- 要点 1
- 要点 2
- 要点 3
::right::
# 右列
```js
const code = 'here'
插槽:::right:: 用于分隔列
带有跨列标题的两列布局。
---
layout: two-cols-header
---
# 对比
::left::
## 选项 A
- 功能 1
- 功能 2
::right::
## 选项 B
- 功能 X
- 功能 Y
插槽:::left:: 和 ::right::
全幻灯片背景图片。
---
layout: image
image: /images/photo.jpg
backgroundSize: cover
---
选项:
image: 图片路径backgroundSize: CSS background-size 属性(cover、contain 等)图片在左,内容在右。
---
layout: image-left
image: /images/diagram.png
backgroundSize: contain
---
# 解释
图表显示:
- 组件 A
- 组件 B
- 它们的关系
图片在右,内容在左。
---
layout: image-right
image: /images/screenshot.png
---
# 功能概述
我们的新功能包括:
- 快速性能
- 易于使用
- 精美设计
嵌入网页。
---
layout: iframe
url: https://sli.dev
---
选项:
url: 要嵌入的 URL在另一侧带有内容的 iframe 布局。
---
layout: iframe-right
url: https://example.com
---
# 实时演示
查看右侧的实时示例
使用整个屏幕,无内边距。
---
layout: full
---
<div class="w-full h-full bg-gradient-to-r from-blue-500 to-purple-600">
<h1 class="text-white text-center pt-40">全屏</h1>
</div>
不应用任何样式 - 完全空白画布。
---
layout: none
---
<div class="custom-everything">
完全自定义内容
</div>
演示文稿的最终幻灯片。
---
layout: end
---
# 谢谢!
有问题吗?
| 布局 | 使用场景 |
|---|---|
default | 一般内容 |
center | 单一聚焦信息 |
cover | 起始幻灯片 |
intro | 作者介绍 |
section | 章节分隔 |
statement | 大胆陈述 |
quote | 引用 |
fact | 统计数据/数字 |
two-cols | 并排内容 |
two-cols-header | 带标题的对比 |
image | 全背景图片 |
image-left | 图片 + 文字 |
image-right | 文字 + 图片 |
iframe | 嵌入网页 |
full | 边到边内容 |
end | 结束幻灯片 |
创建 layouts/my-layout.vue:
<template>
<div class="slidev-layout my-layout">
<slot />
</div>
</template>
<style scoped>
.my-layout {
padding: 2rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
</style>
<!-- layouts/split-header.vue -->
<template>
<div class="slidev-layout split-header">
<header class="header">
<slot name="header" />
</header>
<main class="content">
<div class="left">
<slot name="left" />
</div>
<div class="right">
<slot name="right" />
</div>
</main>
</div>
</template>
<style scoped>
.split-header {
display: grid;
grid-template-rows: auto 1fr;
height: 100%;
}
.header {
padding: 1rem 2rem;
border-bottom: 1px solid #e5e7eb;
}
.content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
padding: 2rem;
}
</style>
用法:
---
layout: split-header
---
::header::
# 对比概述
::left::
## 之前
旧方法详情
::right::
## 之后
新方法详情
<!-- layouts/branded.vue -->
<script setup>
defineProps({
logo: {
type: String,
default: '/logo.png'
},
color: {
type: String,
default: '#3b82f6'
}
})
</script>
<template>
<div class="slidev-layout branded">
<img :src="logo" class="logo" />
<div class="content" :style="{ borderColor: color }">
<slot />
</div>
</div>
</template>
用法:
---
layout: branded
logo: /company-logo.png
color: '#ef4444'
---
# 品牌化内容
主题通常提供额外的布局。例如,seriph 主题包含以下变体:
defaultcover请查阅主题文档以了解可用的布局。
center 进行强调,使用 two-cols 进行对比section 布局cover 和 image 布局使用高分辨率图片---
layout: cover
---
# 标题
---
layout: intro
---
# 关于我
---
layout: section
---
# 第一部分
---
layout: default
---
# 内容...
---
layout: section
---
# 第二部分
---
layout: end
---
# 谢谢
---
layout: two-cols-header
---
# React vs Vue
::left::
## React
- JSX 语法
- 庞大的生态系统
- Facebook 支持
::right::
## Vue
- 模板语法
- 平缓的学习曲线
- 社区驱动
当推荐布局时,请提供:
幻灯片结构:
1. [layout: cover] - 带标题的起始页
2. [layout: intro] - 演讲者介绍
3. [layout: section] - 主题 1 标题
4. [layout: default/two-cols] - 内容幻灯片
5. [layout: section] - 主题 2 标题
6. [layout: image-right] - 演示/截图
7. [layout: fact] - 关键统计数据
8. [layout: end] - 结束页
布局推荐:
- 对于此内容类型,使用 [layout]
- 原因:[解释]
示例:
---
layout: [推荐布局]
[如果需要,添加额外选项]
---
[内容结构]
每周安装量
52
代码仓库
GitHub 星标数
22
首次出现
2026年1月25日
安全审计
安装于
opencode40
codex39
gemini-cli39
github-copilot38
amp38
kimi-cli38
This skill covers all built-in Slidev layouts and teaches you how to use them effectively for different types of content. You'll also learn how to create custom layouts.
Specify a layout in the slide's frontmatter:
---
layout: center
---
# Centered Content
The basic layout for general content.
---
layout: default
---
# Default Layout
Any content works here:
- Lists
- Code blocks
- Images
- Tables
Centers content both horizontally and vertically.
---
layout: center
---
# Big Statement
Perfect for impactful single messages
Best for : Quotes, key takeaways, section titles
The opening slide with prominent title display.
---
layout: cover
background: /images/cover.jpg
---
# Presentation Title
Subtitle or author name
Options :
background: Image URL or colorBest for : First slide, section openers
Introduction slide with author/presenter info.
---
layout: intro
---
# My Presentation
## A Journey Through Code
<div class="absolute bottom-10">
<span class="font-700">
John Doe
</span>
<br>
<span class="text-sm opacity-50">
Senior Developer @ TechCorp
</span>
</div>
Marks the beginning of a new section.
---
layout: section
---
# Part 1
Getting Started
Best for : Dividing presentation into logical sections
Emphasizes a single statement or quote.
---
layout: statement
---
# Code is poetry
Best for : Powerful quotes, key messages
Displays a quotation with attribution.
---
layout: quote
---
# "Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
Martin Fowler
Highlights important facts or statistics.
---
layout: fact
---
# 100%
of developers love Slidev*
<small>*citation needed</small>
Best for : Statistics, numbers, key facts
Two-column layout with left/right content.
---
layout: two-cols
---
# Left Column
- Point 1
- Point 2
- Point 3
::right::
# Right Column
```js
const code = 'here'
**Slot**: `::right::` separates columns
### two-cols-header
Two columns with a spanning header.
```markdown
---
layout: two-cols-header
---
# Comparison
::left::
## Option A
- Feature 1
- Feature 2
::right::
## Option B
- Feature X
- Feature Y
Slots : ::left:: and ::right::
Full-slide background image.
---
layout: image
image: /images/photo.jpg
backgroundSize: cover
---
Options :
image: Image pathbackgroundSize: CSS background-size (cover, contain, etc.)Image on left, content on right.
---
layout: image-left
image: /images/diagram.png
backgroundSize: contain
---
# Explanation
The diagram shows:
- Component A
- Component B
- Their relationship
Image on right, content on left.
---
layout: image-right
image: /images/screenshot.png
---
# Feature Overview
Our new feature includes:
- Fast performance
- Easy to use
- Beautiful design
Embeds a webpage.
---
layout: iframe
url: https://sli.dev
---
Options :
url: URL to embedIframe with content on the opposite side.
---
layout: iframe-right
url: https://example.com
---
# Live Demo
Check out the live example on the right
Uses the entire screen without padding.
---
layout: full
---
<div class="w-full h-full bg-gradient-to-r from-blue-500 to-purple-600">
<h1 class="text-white text-center pt-40">Full Screen</h1>
</div>
No styling applied - complete blank slate.
---
layout: none
---
<div class="custom-everything">
Completely custom content
</div>
Final slide of the presentation.
---
layout: end
---
# Thank You!
Questions?
| Layout | Use Case |
|---|---|
default | General content |
center | Single focused message |
cover | Opening slide |
intro | Author introduction |
section | Section divider |
statement | Bold statement |
Create layouts/my-layout.vue:
<template>
<div class="slidev-layout my-layout">
<slot />
</div>
</template>
<style scoped>
.my-layout {
padding: 2rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
</style>
<!-- layouts/split-header.vue -->
<template>
<div class="slidev-layout split-header">
<header class="header">
<slot name="header" />
</header>
<main class="content">
<div class="left">
<slot name="left" />
</div>
<div class="right">
<slot name="right" />
</div>
</main>
</div>
</template>
<style scoped>
.split-header {
display: grid;
grid-template-rows: auto 1fr;
height: 100%;
}
.header {
padding: 1rem 2rem;
border-bottom: 1px solid #e5e7eb;
}
.content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
padding: 2rem;
}
</style>
Usage:
---
layout: split-header
---
::header::
# Comparison Overview
::left::
## Before
Old approach details
::right::
## After
New approach details
<!-- layouts/branded.vue -->
<script setup>
defineProps({
logo: {
type: String,
default: '/logo.png'
},
color: {
type: String,
default: '#3b82f6'
}
})
</script>
<template>
<div class="slidev-layout branded">
<img :src="logo" class="logo" />
<div class="content" :style="{ borderColor: color }">
<slot />
</div>
</div>
</template>
Usage:
---
layout: branded
logo: /company-logo.png
color: '#ef4444'
---
# Branded Content
Themes often provide additional layouts. For example, the seriph theme includes variations like:
default with refined typographycover with elegant stylingCheck theme documentation for available layouts.
center for emphasis, two-cols for comparisonssection layout consistentlycover and image layouts---
layout: cover
---
# Title
---
layout: intro
---
# About Me
---
layout: section
---
# Part 1
---
layout: default
---
# Content...
---
layout: section
---
# Part 2
---
layout: end
---
# Thank You
---
layout: two-cols-header
---
# React vs Vue
::left::
## React
- JSX syntax
- Large ecosystem
- Facebook backing
::right::
## Vue
- Template syntax
- Gentle learning curve
- Community driven
When recommending layouts, provide:
SLIDE STRUCTURE:
1. [layout: cover] - Opening with title
2. [layout: intro] - Speaker introduction
3. [layout: section] - Topic 1 header
4. [layout: default/two-cols] - Content slides
5. [layout: section] - Topic 2 header
6. [layout: image-right] - Demo/screenshot
7. [layout: fact] - Key statistic
8. [layout: end] - Closing
LAYOUT RECOMMENDATION:
- For this content type, use [layout]
- Reason: [explanation]
EXAMPLE:
---
layout: [recommended]
[additional options if needed]
---
[Content structure]
Weekly Installs
52
Repository
GitHub Stars
22
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
opencode40
codex39
gemini-cli39
github-copilot38
amp38
kimi-cli38
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
125,600 周安装
故事重规划器 - Linear史诗需求变更时自动更新故事,保留/更新/废弃/创建操作分类
220 周安装
飞书/ Lark API 命令行工具 - 自动化消息、文档、表格与日历管理 | feishu-lark-agent
217 周安装
ln-780-bootstrap-verifier:项目引导验证协调器 | 构建测试容器编排与报告生成
220 周安装
RICE评分法故事优先级排序器 - 基于市场调研的产品功能优先级评估工具
219 周安装
Phaser游戏自动化宣传视频录制工具:50FPS竖屏视频生成,适配TikTok/Reels
224 周安装
Next.js 16 完全指南:掌握缓存组件、Turbopack、proxy.ts 与 React Compiler
221 周安装
quote| Quotations |
fact | Statistics/numbers |
two-cols | Side-by-side content |
two-cols-header | Comparison with header |
image | Full background image |
image-left | Image + text |
image-right | Text + image |
iframe | Embedded webpage |
full | Edge-to-edge content |
end | Closing slide |