# Route parameters, location & querystring ## Accessing route parameters In your route components: ```svelte

Book ID: {routeParams.id}

``` ## Accessing location and querystring ```svelte

Current page: {currentPath}

Query: {query}

Params: {JSON.stringify(params)}

``` ## TypeScript support with generics All helper functions support TypeScript generics for full intellisense: ```typescript // Define your types interface UserParams { userId: string tab?: string } interface UserQuery { search?: string page?: number tags?: string[] } // Use with type parameters for full intellisense const p = $derived(routeParams()) const q = $derived(query()) if (p) { const userId = p.userId // ✅ TypeScript knows this exists const tab = p.tab || 'profile' // ✅ TypeScript knows this is optional } const search = $derived(q.search || '') const page = $derived(q.page ? Number(q.page) : 1) const tags = $derived(q.tags || []) // ✅ TypeScript knows this is string[] ```