Default Behavior
By default, webreel provides:- Animated cursor: A white cursor with black outline that moves smoothly using bezier curves and realistic easing
- Keystroke HUD: A semi-transparent overlay showing keyboard shortcuts when you use the
keyaction or modifier clicks - Cursor sizing: The cursor scales down slightly when clicking (0.75x) to provide visual feedback
Cursor Animation
Movement Physics
Cursor movement is based on Fitts’s law, creating realistic motion:- Distance-based duration: Longer distances take more time
- Bezier curve paths: Slight arc to movement, not straight lines
- Micro-jitter: Subtle randomness mimics human hand movement
- Asymmetric easing: Quick acceleration, gentle deceleration
Cursor Start Position
The cursor starts at a random position just outside the viewport edge, creating a natural entry effect. You can control this behavior in the RecordingContext (packages/@webreel/core/src/actions.ts:60):Keystroke HUD
When the HUD Appears
The keystroke HUD automatically displays when:- You use a
keyaction with modifier keys:
- You click with modifiers:
HUD Display Format
Modifier keys are shown with platform-appropriate symbols:cmd→ ⌘ (on macOS) or Cmd (on Windows/Linux)ctrl→ Ctrlshift→ ⇧alt→ ⌥
mod keyword automatically resolves to cmd on macOS and ctrl elsewhere.
HUD Position
By default, the HUD appears at the bottom center of the viewport. You can move it to the top:Theme Customization
Complete Theme Structure
You can customize both the cursor and HUD at the top level (affecting all videos) or per-video:Cursor Options
| Option | Type | Default | Description |
|---|---|---|---|
image | string | Built-in SVG | Path to a custom SVG file relative to config directory |
size | number | 24 | Cursor size in pixels |
hotspot | "top-left" | "center" | "top-left" | Click position relative to cursor bounds |
HUD Options
| Option | Type | Default | Description |
|---|---|---|---|
background | string | "rgba(0,0,0,0.5)" | CSS background color |
color | string | "rgba(255,255,255,0.85)" | Text color |
fontSize | number | 56 | Font size in pixels |
fontFamily | string | "Geist", -apple-system, BlinkMacSystemFont, sans-serif | CSS font family |
borderRadius | number | 18 | Border radius in pixels |
position | "top" | "bottom" | "bottom" | Vertical position of HUD |
Custom Cursor SVG
Creating Your Cursor
Create a custom cursor as an SVG file:cursor.svg next to your webreel.config.json.
Using the Custom Cursor
Reference it in your theme:Hotspot Setting
Thehotspot determines where clicks occur relative to the cursor bounds:
"top-left": Click at the cursor’s top-left corner (default, appropriate for traditional arrow cursors)"center": Click at the cursor’s center (appropriate for crosshair or symmetric designs)
Theme Examples
Code Editor Theme
From the custom-theme example:- Larger cursor (32px)
- Monospace font for HUD
- Top-positioned HUD (doesn’t obscure code at bottom)
- Dark slate background with lighter text
Minimalist Theme
Bold Accent Theme
Per-Video Overrides
You can override the global theme for specific videos:header-demo uses a top-positioned HUD while footer-demo inherits the bottom position.
Implementation Details
Overlay Injection
Webreel injects overlays into the page DOM before recording starts (packages/@webreel/core/src/overlays.ts:23):position: fixedwithz-index: 999999to stay on toppointer-events: noneto avoid interfering with interactions- CSS transitions for smooth show/hide animations
Show/Hide Timing
The HUD appears when a key action starts and hides after a delay (packages/@webreel/core/src/actions.ts:554):Troubleshooting
Cursor not visible
Cursor not visible
Cause: The cursor SVG file path is incorrect or the file is malformed.Solution: Verify the path is relative to your
webreel.config.json. Check the SVG is valid by opening it in a browser.HUD appears behind page content
HUD appears behind page content
Cause: Your page has elements with very high
z-index values.Solution: The HUD uses z-index: 999999. If your page uses higher values, this is expected. The recording still works correctly; the HUD just won’t be visible during preview mode.Custom font not loading
Custom font not loading
Cause: The font family you specified isn’t available on the page.Solution: Include a fallback font family:Or ensure the font is loaded on your page via
<link> or @font-face.Theme changes not appearing
Theme changes not appearing
Cause: Config file wasn’t saved or has syntax errors.Solution: Validate your config:Check for JSON syntax errors (missing commas, quotes, etc.).
Next Steps
Output Formats
Configure MP4, GIF, and WebM output
Advanced Actions
Learn drag-and-drop and scrolling
Theme Reference
Complete theme configuration reference