Command Palette

Search for a command to run...

Назад к скиллам
скилл № 15018

interactive

Guide for embedding interactive demos and mock UIs in Slidev presentations. Use when adding clickable prototypes, animated workflows, Vue components, or…

БесплатноБез исполняемых скриптов
vinnie357от vinnie357★ 30 звёзд на GitHub

Установить interactive в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Slidev Interactive Demos

Guide for embedding interactive demos, mock UIs, and animated workflows in Slidev presentations.

Two Integration Paths

Choose based on portability and integration requirements:

Concern Vue Components Iframe / HTML5
Slidev integration Tight — shares state, v-click, themes Loose — isolated sandbox
Portability Requires Slidev project Self-contained HTML file
Reactivity Full Vue 3 reactivity Vanilla JS or any framework
Styling Inherits slide theme Independent CSS
Hot reload Yes (Vite HMR) Requires manual refresh
Best for Demos that respond to clicks, slide context Standalone prototypes, third-party widgets

For Vue component patterns, see references/vue-components.md.
For iframe and standalone HTML patterns, see references/iframe-mocks.md.
For animation patterns, see references/animation-patterns.md.

Vue Component Path

Auto-Import

Place .vue files in components/ — Slidev auto-imports them by filename:

components/
├── LoginForm.vue
├── ApiExplorer.vue
└── DashboardWidget.vue

Use directly in slides without import statements:

---
layout: default
---

# Live Demo

<LoginForm />

Reactive State with Vue 3

Use the Composition API for state management:

<script setup>
import { ref, computed } from 'vue'

const step = ref(0)
const steps = ['Input', 'Validate', 'Submit', 'Success']
const currentStep = computed(() => steps[step.value])

function advance() {
  if (step.value < steps.length - 1) step.value++
}
function reset() {
  step.value = 0
}
</script>

Integration with v-click

Wrap components in v-click for progressive reveal, or use $clicks for step-aware behavior:

<v-click>
  <ApiExplorer />
</v-click>

<!-- Or bind clicks inside the component -->
<WorkflowDemo :step="$clicks" />

Inside the component, receive step as a prop and render accordingly:

<script setup>
const props = defineProps({ step: { type: Number, default: 0 } })
</script>

<template>
  <div class="workflow">
    <StepItem v-for="(s, i) in steps" :key="i"
              :active="i === props.step"
              :done="i < props.step" />
  </div>
</template>

Scoped Styles

Use <style scoped> to prevent leaking styles into the slide:

<style scoped>
.demo-container {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
}

.active-step {
  background: var(--slidev-theme-primary, #4f46e5);
  color: white;
}
</style>

Slide-Aware Behavior with $slidev

Access navigation state inside components using the useSlideContext composable:

<script setup>
import { useSlideContext } from '@slidev/client'

const { $slidev } = useSlideContext()

// Current slide number
const slideNo = computed(() => $slidev.nav.currentPage)

// Total clicks on this slide
const clicks = computed(() => $slidev.nav.clicks)

// Check if presenting (vs. browsing)
const isPresenting = computed(() => $slidev.nav.isPresenter)
</script>

Iframe / HTML5 Path

Directory Structure

Place self-contained mocks in public/mocks/:

public/
└── mocks/
    ├── dashboard/
    │   ├── index.html
    │   ├── style.css
    │   └── app.js
    └── login-flow/
        └── index.html   # inline CSS/JS preferred for portability

Slidev iframe Layouts

Use built-in layouts to embed mocks:

---
layout: iframe
url: /mocks/dashboard/index.html
---

Split layouts for side-by-side content:

---
layout: iframe-right
url: /mocks/login-flow/index.html
---

## Login Flow

Walk through the authentication steps:

1. User enters credentials
2. Client validates format
3. Server returns JWT
4. Redirect to dashboard

Importing Existing Mocks

To embed an existing standalone HTML prototype:

  1. Copy the mock to public/mocks/<name>/
  2. Fix relative asset paths — all paths must work from /mocks/<name>/index.html
  3. Bundle external CSS/JS inline or copy dependencies into the mock directory
  4. Reference via url: /mocks/<name>/index.html in slide frontmatter

Asset path checklist:

  • ./style.css works when style.css is in the same directory
  • ../shared/reset.css works if the shared/ directory is within public/
  • Absolute CDN URLs work if network is available during presentation
  • Prefer inline styles/scripts for fully offline presentations

postMessage Communication

Send data from the iframe to the parent slide:

// Inside the mock (iframe)
function notifyParent(event, payload) {
  window.parent.postMessage({ event, payload }, '*')
}

// Example: notify parent when user completes a step
document.querySelector('#submit-btn').addEventListener('click', () => {
  notifyParent('form-submitted', { user: '[email protected]' })
})

Listen in the slide (embed in a Vue component):

<script setup>
import { onMounted, onUnmounted, ref } from 'vue'

const lastEv
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/animation-patterns.md
  • references/iframe-mocks.md
  • references/vue-components.md

FAQ

Что делает скилл interactive?

Guide for embedding interactive demos and mock UIs in Slidev presentations. Use when adding clickable prototypes, animated workflows, Vue components, or standalone HTML5 mock pages to slide decks.

Как установить скилл interactive?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл interactive запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить interactive с