Skip to main content
Version: 2.0.0

Optional Fields

The path function also accepts the optional fields search, hash and trailingSlash.

---
import { $path } from "astro-typesafe-routes";
---

<a
href={$path("/posts/[postId]", {
params: { postId: "1" },
hash: "header",
search: { filter: "recent" },
trailingSlash: true
})}
>
Blog Post
</a>