Presentation slides for developers
<div @click=”$slidev.nav.next” class=”mt-12 py-1” hover:bg=”white op-10”>
Press Space for next page
transition: fade-out —
Slidev is a slides maker and presenter designed for developers, consist of the following features
Read more about Why Slidev?
transition: slide-up level: 2 —
Hover on the bottom-left corner to see the navigation’s controls panel, learn more
| right / space | next animation or slide |
| left / shiftspace | previous animation or slide |
| up | previous slide |
| down | next slide |
Here!
layout: two-cols layoutClass: gap-16 —
You can use the Toc component to generate a table of contents for your slides:
<Toc minDepth="1" maxDepth="1" />
The title will be inferred from your slide content, or you can override it with title and level in your frontmatter.
::right::
layout: image-right image: https://cover.sli.dev —
Use code snippets and get the highlighting directly, and even types hover!
```ts [filename-example.ts] {all|4|6|6-7|9|all} twoslash // TwoSlash enables TypeScript hover information // and errors in markdown code blocks // More at https://shiki.style/packages/twoslash import { computed, ref } from ‘vue’
const count = ref(0) const doubled = computed(() => count.value * 2)
doubled.value = 2
<arrow v-click="[4, 5]" x1="350" y1="310" x2="195" y2="342" color="#953" width="2" arrowSize="1" />
<!-- This allow you to embed external code blocks -->
<<< @/snippets/external.ts#snippet
<!-- Footer -->
[Learn more](https://sli.dev/features/line-highlighting)
<!-- Inline style -->
<style>
.footnotes-sep {
@apply mt-5 opacity-10;
}
.footnotes {
@apply text-sm opacity-75;
}
.footnote-backref {
display: none;
}
</style>
<!--
Notes can also sync with clicks
[click] This will be highlighted after the first click
[click] Highlighted with `count = ref(0)`
[click:3] Last click (skip two clicks)
-->
---
level: 2
---
# Shiki Magic Move
Powered by [shiki-magic-move](https://shiki-magic-move.netlify.app/), Slidev supports animations across multiple code snippets.
Add multiple code blocks and wrap them with <code>````md magic-move</code> (four backticks) to enable the magic move. For example:
````md magic-move {lines: true}
```ts {*|2|*}
// step 1
const author = reactive({
name: 'John Doe',
books: [
'Vue 2 - Advanced Guide',
'Vue 3 - Basic Guide',
'Vue 4 - The Mystery'
]
})
```ts {*|1-2|3-4|3-4,8} // step 2 export default { data() { return { author: { name: ‘John Doe’, books: [ ‘Vue 2 - Advanced Guide’, ‘Vue 3 - Basic Guide’, ‘Vue 4 - The Mystery’ ] } } } }
```ts
// step 3
export default {
data: () => ({
author: {
name: 'John Doe',
books: [
'Vue 2 - Advanced Guide',
'Vue 3 - Basic Guide',
'Vue 4 - The Mystery'
]
}
})
}
Non-code blocks are ignored.
<!-- step 4 -->
<script setup>
const author = {
name: 'John Doe',
books: [
'Vue 2 - Advanced Guide',
'Vue 3 - Basic Guide',
'Vue 4 - The Mystery'
]
}
</script>
---
# Components
<div grid="~ cols-2 gap-4">
<div>
You can use Vue components directly inside your slides.
We have provided a few built-in components like `<Tweet/>` and `<Youtube/>` that you can use directly. And adding your custom components is also super easy.
```html
<Counter :count="10" />
<Counter :count=”10” m=”t-4” />
Check out the guides for more.
</div>
</div>
class: px-20 —
Slidev comes with powerful theming support. Themes can provide styles, layouts, components, or even configurations for tools. Switching between themes by just one edit in your frontmatter:
Read more about How to use a theme and check out the Awesome Themes Gallery.
You can add v-click to elements to add a click animation.
v-mark directive
also allows you to add
inline marks
, powered by [Rough Notation](https://roughnotation.com/):
```html
inline markers
```
Motion animations are powered by @vueuse/motion, triggered by v-motion directive.
<div
v-motion
:initial="{ x: -80 }"
:enter="{ x: 0 }"
:click-3="{ x: 80 }"
:leave="{ x: 1000 }"
>
Slidev
</div>
</div>
<div v-motion :initial=”{ x:35, y: 30, opacity: 0}” :enter=”{ y: 0, opacity: 1, transition: { delay: 3500 } }”>
</div>
$\LaTeX$ is supported out-of-box. Powered by $\KaTeX$.
Inline $\sqrt{3x-1}+(1+x)^2$
Block \({1|3|all} \begin{aligned} \nabla \cdot \vec{E} &= \frac{\rho}{\varepsilon_0} \\ \nabla \cdot \vec{B} &= 0 \\ \nabla \times \vec{E} &= -\frac{\partial\vec{B}}{\partial t} \\ \nabla \times \vec{B} &= \mu_0\vec{J} + \mu_0\varepsilon_0\frac{\partial\vec{E}}{\partial t} \end{aligned}\)
You can create diagrams / graphs from textual descriptions, directly in your Markdown.
Learn more: Mermaid Diagrams and PlantUML Diagrams
foo: bar dragPos: square: 685,23,167,_,-16 —
Double-click on the draggable elements to edit their positions.
<img v-drag="'square'" src="https://sli.dev/logo.png">
<v-drag text-3xl>
<div class="i-carbon:arrow-up" />
Use the `v-drag` component to have a draggable container!
</v-drag>

<v-drag-arrow two-way />
src: ./pages/imported-slides.md hide: false —
Slidev provides built-in Monaco Editor support.
Add {monaco} to the code block to turn it into an editor:
```ts {monaco} import { ref } from ‘vue’ import { emptyArray } from ‘./external’
const arr = ref(emptyArray(10))
Use `{monaco-run}` to create an editor that can execute the code directly in the slide:
```ts {monaco-run}
import { version } from 'vue'
import { emptyArray, sayHello } from './external'
sayHello()
console.log(`vue ${version}`)
console.log(emptyArray<number>(10).reduce(fib => [...fib, fib.at(-1)! + fib.at(-2)!], [1, 1]))
layout: center class: text-center —
Documentation · GitHub · Showcases