Github
Supergoto
Extension of sveltekit's goto module with more navigation options and URL Search parameters management.
Demo
Options:
Replace state
If enabled, will replace the current `history` entry rather than creating a new one with `pushState`
No scroll
If enabled, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation
Keep focus
If enabled, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body
State
The state of the new/updated history entry
Invalidate all
If enabled, all `load` functions of the page will be rerun. See https://kit.svelte.dev/docs/load#rerunning-load-functions for more info on invalidation.
External
If enabled, navigation will be allowed to external host URLs. By default navigation to other host/origin URLs is blocked
Preserve current URL for redirection later
If enabled, the current URL will be added as a search param with the key `redirectTo` which can be retrieved after navigation
Update hash params
Supplied object will be serialized and stored as hash parameter
Preserve current hash parameters
If enabled, the current hash parameters will be preserved and will remain after navigation. By default, hash parameters are cleared on navigation
URL Search parameters
Supplied record/map will be serialized and stored as url search parameter
Preserve current URL search parameters
If enabled, the current search parameters will be preserved and will remain after navigation. By default, search parameters are cleared on navigation