You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-1Lines changed: 42 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,14 @@ Embed a live VS Code IDE in your [Slidev](https://sli.dev) presentations.
9
9
10
10
Powered by [coderaft](https://github.com/pithings/coderaft), a zero-dependency redistribution of code-server that installs in under a second.
11
11
12
+
## 🎤 Why
13
+
14
+
I often give live presentations where I need to show and modify code in real time. Switching between slides and a local IDE breaks the flow — alt-tabbing mid-talk is jarring for the audience and for me.
15
+
16
+
`slidev-addon-livecode` embeds a full VS Code instance directly into your slides, so your code demos stay in context. No context switching, no alt-tabbing.
17
+
18
+
> 🗞️ **Inspired by**[Stop Alt-Tabbing: Embed an IDE in Your Live-Coding Slides](https://mickaelalvs.dev/articles/stop-alt-tabbing-embed-ide-live-coding-slides).
19
+
12
20
## 📦 Install
13
21
14
22
```bash
@@ -85,7 +93,7 @@ Use `disableInitialFocus` to prevent VS Code from stealing keyboard focus when y
85
93
<Editor session="demo" disableInitialFocus />
86
94
```
87
95
88
-
Focus is held on the slide for 5 seconds after VS Code loads, then released normally. The user can interact with VS Code freely after that.
96
+
Focus is held on the slide, after an interaction, the user can interact with VS Code freely after that.
89
97
90
98
## ⚡ Preload
91
99
@@ -144,16 +152,49 @@ Per-component props override these values.
144
152
| `startTimeout` | `number` | `30000` | Max startup time in ms before the session is marked as failed. |
145
153
| `zoom` | `number` | `1` | Scale factor for the VS Code UI (e.g. `0.8` for 80%). |
`<Editor />`works alongside all [Slidev built-in features](https://sli.dev/features/), drag, resize, click animations, and more. Compose it freely with the rest of your slide content.
165
+
147
166
## ⚠️ Static exports
148
167
149
168
The `<Editor />` component requires Slidev dev mode. In static exports (`slidev build`), it renders a placeholder instead. Plan your demos accordingly.
150
169
170
+
## đź”— Combine with
171
+
172
+
Pair `<Editor />` with other addons for a fully self-contained demo environment — no need to leave your slides at all:
173
+
174
+
- **[slidev-addon-liveshell](https://npmx.dev/package/slidev-addon-liveshell)** — embed a live terminal directly in your slide alongside the editor.
175
+
- **An `<iframe>` pointing to your dev server** — embed your running app next to the editor. Edit code in VS Code, and the hot reload updates the iframe in real time, all without leaving the presentation.
0 commit comments