show, hide, and clear triggers. Order doesn’t matter. Unknown tokens are silently ignored.
Effects
Animation effects control how blocks enter and exit the stage.| Effect | Enter Behavior | Exit Behavior | Best For |
|---|---|---|---|
fade | Opacity 0→1 | Opacity 1→0 | General purpose (default) |
slide | From right | To left | Progression, new concepts |
slide-up | From bottom | To top | Results, conclusions |
grow | Scale from center | Scale to center | Focal elements, data structures |
typewriter | Lines appear sequentially | Fade out | First code reveals |
none | Instant | Instant | Reference material, no ceremony |
Effect Selection Guide
First code reveal:Duration
Duration specifies how long the animation takes. Supports seconds (s) or milliseconds (ms).
| Duration | Milliseconds | Use Case |
|---|---|---|
0.15s | 150ms | Micro-interactions |
0.3s | 300ms | Default — standard content transitions |
0.5s | 500ms | Deliberate, emphasized reveals |
1s | 1000ms | Slow, dramatic reveals |
1.5s | 1500ms | Typewriter, moderate speed |
2s | 2000ms | Typewriter, slow/detailed |
300ms | 300ms | Explicit milliseconds (equivalent to 0.3s) |
Duration Guidelines
Micro-interactions:- Focus shifts, annotations: no explicit duration — these are instant state changes
- 0.3-0.5s — fast enough to not feel sluggish, slow enough to register
- Formula:
duration = lines * 0.1s- 10 lines → 1s
- 15 lines → 1.5s
- 20 lines → 2s
- Don’t go faster than 50ms/line (too glitchy) or slower than 150ms/line (too tedious)
- Use the default. Don’t override clear duration unless you have a specific reason.
Performance Rule
Never exceed 400ms for product UI. This is Emil Kowalski’s interaction rule: interactions should complete in 150-250ms, never exceed 400ms. Applied to Handhold: show/hide/clear should be under 500ms. Only typewriter (a deliberate slow reveal) goes longer.Easing
Easing functions control the acceleration curve of animations.| Easing | Description | Use When |
|---|---|---|
ease-out | Fast start, gentle stop | Elements entering (default) |
ease-in-out | Gentle start and stop | Elements moving on screen |
spring | Physics-based with overshoot | Playful, snappy, data structures |
linear | Constant speed | Typewriter, mechanical processes |
reveal | Smooth cinematic reveal | First reveals, dramatic moments |
emphasis | Punchy overshoot | Drawing attention, key concepts |
handoff | Calm handoff between scenes | Scene transitions, topic changes |
Easing Selection Guide
Default (elements entering):Defaults
If no animation tokens are provided:- Effect:
fade - Duration:
0.3s(300ms) - Easing:
ease-out
{{show: block slide}}→slide,0.3s,ease-out{{show: block 0.5s}}→fade,0.5s,ease-out{{show: block spring}}→fade,0.3s,spring
Complete Examples
Typewriter Code Reveal
typewriter 2s linear— 20 lines at 2s = 100ms/line. Mechanical, constant speed.- Narration starts DURING the typewriter. The audience reads ahead naturally.
Data Structure Entrance
grow+spring— the graph snaps in playfully with a slight overshoot.- Perfect for the first thing on screen to set an engaging tone.
Slide Progression
slidecreates a left-to-right flow, signaling progression.- Consistent 0.3s timing creates a steady rhythm.
Split Panel Entry
- Left panel (code) enters first with a standard slide.
- Right panel (preview) enters slightly delayed with a playful spring bounce.
- Staggered timing guides the eye left→right.
Result Conclusion
slide-upfeels like a conclusion rising into view.- Reinforces the “here’s the result” moment.
No-Ceremony Reference
none= instant. No animation ceremony for supporting material.- Keeps focus on the narration, not the visual transition.
TypeScript Definition
Fromsrc/types/lesson.ts: