Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🫦 An SPA router for Svelte that allows you to divide & conquer your app with nested routers, snippets, and more.

License

NotificationsYou must be signed in to change notification settings

mateothegreat/svelte5-router

Repository files navigation

logo

An SPA router for Svelte that allows you to divide & conquer your app with nested routers, snippets, and more.

Features

  • Built for Svelte 5 🚀!
  • Divide & conquer - use nested routers all over the place.
  • Use components, snippets, or both 🔥!
  • Use regex paths (e.g./foo/(.*?)/bar) and/or named parameters together.
  • Use async routes simply withcomponent: async () => import("./my-component.svelte").
  • Add hooks to your routes to control the navigation flow 🔧.
  • Automagic styling of your anchor tags 💄.
  • Helper methods 🛠️ to make your life easier.
  • Debugging tools included 🔍.

Latest News

July 1, 2025

Version 2.15.4 released! 🎉 with some healthy updates!

Note

I'd like to share what svelte5-router is doing in the wild! If you're using it, please share your project with me by sending me a message on discord at@mateothegreat or just create anew issue and I'll add it to the list. 🙏

Installation

npm install @mateothegreat/svelte5-router

Now you can simply:

<ahref="/dashboard"use:route>Dashboard</a>

By addinguse:route you will prevent the page from reloading and instead let the router take the wheel 🤸. Peruse the rest of the documentation atdocs/ for more details.

Note

Withoutuse:route the website will be reloaded after opening a new route. To prevent this usegoto() oruse:route so only the Route element get's changed.

and/ship-it!

Seeactions.md#route for the deets..

Table of Contents

Note

Includellms.txt in your LLM prompt to get add rich context to your tasks by referencinghttps://raw.githubusercontent.com/mateothegreat/svelte5-router/refs/heads/main/llms.txt.

How it works

When the browser URL changes, the router instance is triggered. It then registers the route in the registry, evaluates the route matching, and resolves the route.

Router Architecture

Note

You can view more diagrams indiagrams.md.

About

🫦 An SPA router for Svelte that allows you to divide & conquer your app with nested routers, snippets, and more.

Topics

Resources

License

Stars

Watchers

Forks

Contributors14

Languages


[8]ページ先頭

©2009-2025 Movatter.jp