What if one page could magically become any page you want, just by changing the URL?
Why Dynamic route parameters in Svelte? - Purpose & Use Cases
Imagine building a website where each user has a unique profile page. You try to create a separate HTML file for every user manually, like user1.html, user2.html, and so on.
This manual method quickly becomes impossible to manage. Every time a new user joins, you must create a new file. It's slow, error-prone, and your site grows messy and hard to update.
Dynamic route parameters let you create one flexible route that changes based on the URL. Instead of many files, you have one template that automatically shows the right content for each user.
GET /user1.html GET /user2.html
GET /user/[id]
You can build scalable, clean websites that show personalized content without extra files or complicated code.
Think of an online store where each product page URL changes based on the product ID, but all use the same page template to display details.
Manual page creation for each item is slow and messy.
Dynamic route parameters let one route handle many URLs.
This makes your app easier to build, update, and scale.