Master v-click and sequential animations in Slidev. Use this skill to reveal content progressively and create engaging presentations.
Click Animations in Slidev
This skill covers all click-based animations in Slidev, including v-click, v-after, v-clicks, v-switch, and motion directives for creating dynamic, engaging presentations.
When to Use This Skill
Revealing content step by step
Building up complex diagrams
Creating suspense or emphasis
Guiding audience attention
Interactive presentation flow
v-click Basics
Component Syntax
<v-click>
This appears on the first click
</v-click>
<v-clicksevery="2">- Items 1-2 together
- (same click)
- Items 3-4 together
- (same click)
</v-clicks>
Hide on Click
v-click.hide
<divv-click.hide>This disappears on click</div>
v-click with hide
<v-clickhide>
This content will be hidden after the click
</v-click>
Range-based Hiding
<divv-click.hide="[2, 4]">
Visible until click 2, hidden on clicks 2-3, visible again at click 4
</div>
v-switch
Switch between different content based on clicks:
<v-switch><template #1>Content at click 1</template><template #2>Content at click 2</template><template #3>Content at click 3</template><template #4-6>Content at clicks 4, 5, and 6</template><template #default>Default content (before click 1)</template></v-switch>
# The Solution<divv-click.hide="2"><h2>Before</h2><pre>Old code here</pre></div><divv-click="2"><h2>After</h2><pre>New improved code</pre></div>
Animated Highlight
# Important Concept<pv-click="1">
This is a paragraph with
<spanv-motion:initial="{ background: 'transparent' }":click-2="{ background: '#fef08a' }"class="px-1"
> highlighted text
</span>
that appears.
</p>
Step-by-Step Code
```typescript {1|2|3|all}
const name = 'Slidev'
const version = '0.50'
console.log(`${name} v${version}`)
```