Overview of svelte-spa-router
mainWhat is svelte-spa-router?
svelte-spa-router is a lightweight, hash-based router specifically optimized for Svelte 5 Single Page Applications (SPAs).
Key Features
- Hash-based routing: Uses the URL fragment (the part after
#) for navigation. This is ideal for static SPAs because it does not require any server-side configuration to handle deep links or page refreshes. - Minimal footprint: Designed to be simple and lightweight.
- Regex-based route parsing: Uses
regexparamto support route parameters (e.g.,/book/:id?).
Version Compatibility
- Svelte 5: Use the current version.
- Svelte 3 and 4: Use the v4 branch instead.