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
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,16 @@ Use `disableInitialFocus` to prevent VS Code from stealing keyboard focus when y
82
82
83
83
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.
84
84
85
+
## ⚡ Preload
86
+
87
+
Use `preload` to warm up the VS Code session before the user reaches the slide. Slidev mounts adjacent slides in the background, so the session can start while the user is still on the previous slide:
88
+
89
+
```md
90
+
<Editor session="demo" preload />
91
+
```
92
+
93
+
Combine with `disableInitialFocus` for a seamless experience — the IDE is ready and keyboard navigation still works on slide entry.
94
+
85
95
## 🔒 Keep the session alive across navigation
86
96
87
97
By default, navigating away from a slide stops the session. Use `persist` to keep it running:
@@ -124,6 +134,7 @@ Per-component props override these values.
124
134
| `hideStatusBar` | `boolean` | `false` | Hide the VS Code status bar (bottom bar). |
125
135
| `height` | `string` | `100%` | CSS height of the editor container. |
126
136
| `persist` | `boolean` | `false` | Keep the session alive when navigating away. |
137
+
| `preload` | `boolean` | `false` | Start the session while the slide is not yet active (requires Slidev preload). |
127
138
| `port` | `number` | auto | Force a specific port for this session. |
128
139
| `startTimeout` | `number` | `30000` | Max startup time in ms before the session is marked as failed. |
129
140
| `zoom` | `number` | `1` | Scale factor for the VS Code UI (e.g. `0.8` for 80%). |
0 commit comments