Documentation
Everything you need to use svelte-p5: install, three layers, recipes for common patterns, and migration from p5-svelte.
Start
Concepts
Recipes
- Migrate from p5-svelte
API mapping and ten-minute port.
- Shared state across sketches
A reactive class as the single source of truth for a dashboard.
- Mouse, touch, and hit-testing
Event handlers, hit-tests, and syncing hover with UI.
- Data-driven visualizations
Loading data, master clocks, scales, and on-demand redraws.
- Cleanup & lifecycle
How p5 instances persist across mount/unmount and what the wrapper does about it.
- Performance
FES, font atlases, color caches.
- HiDPI
Sharp canvases on retina displays.