---
name: slidev-components
description: Leverage Vue components in Slidev slides. Use this skill to add interactivity with built-in components or create custom ones.
---
# Slidev Components
This skill covers using Vue components in Slidev, including all built-in components and how to create custom interactive elements for your presentations.
## When to Use This Skill
- Adding interactive elements to slides
- Using built-in Slidev components
- Creating custom Vue components
- Building reusable presentation elements
- Adding dynamic content
## Using Components
Components can be used directly in Markdown:
```markdown
# My Slide
```
## Built-in Components
### Arrow
Draws an arrow between points.
```markdown
```
**Props**:
- `x1`, `y1`: Start coordinates
- `x2`, `y2`: End coordinates
- `color`: Arrow color
- `width`: Line width
### VDragArrow
Draggable arrow (useful for presentations).
```markdown
```
### AutoFitText
Automatically adjusts font size to fit container.
```markdown
```
**Props**:
- `max`: Maximum font size
- `min`: Minimum font size
- `modelValue`: Text content
### LightOrDark
Renders different content based on theme.
```markdown
```
### Link
Navigation link to other slides.
```markdown
Go to slide 42
Go to intro
```
### SlideCurrentNo / SlidesTotal
Display slide numbers.
```markdown
Slide of
```
### Toc (Table of Contents)
Generates a table of contents.
```markdown
```
**Props**:
- `maxDepth`: Maximum heading depth
- `mode`: Display mode (`all`, `onlyCurrentTree`, `onlySiblings`)
### Transform
Applies CSS transforms.
```markdown
Scaled content
Rotated and scaled
```
**Props**:
- `scale`: Scale factor
- `rotate`: Rotation in degrees
### Tweet
Embeds a tweet.
```markdown
```
### Youtube
Embeds a YouTube video.
```markdown
```
**Props**:
- `id`: YouTube video ID
- `width`, `height`: Dimensions
### SlidevVideo
Embeds a video file.
```markdown
```
**Props**:
- `autoplay`: Auto-play on slide enter
- `controls`: Show video controls
- `loop`: Loop video
### RenderWhen
Conditional rendering based on context.
```markdown
Only visible in slide view
Only visible in presenter view
```
**Context options**: `slide`, `presenter`, `previewNext`, `print`
### VDrag
Makes elements draggable.
```markdown
Drag me!
Positioned draggable
```
## Animation Components
### VClick
Reveals on click.
```markdown
Revealed on first click
Revealed on second click
```
### VClicks
Reveals children sequentially.
```markdown
- First item
- Second item
- Third item
```
**Props**:
- `depth`: Depth for nested lists
- `every`: Items per click
### VAfter
Reveals with the previous element.
```markdown
FirstAppears with first
```
### VSwitch
Switches between content based on clicks.
```markdown
Step 1 content
Step 2 content
Step 3 content
```
## Creating Custom Components
### Basic Component
Create `components/Counter.vue`:
```vue