RepositoryTypeScript
paoloricciuti

paoloricciuti/sveltekit-search-params

The easiest way to read and WRITE from query parameters in sveltekit.

673stars
24forks
19issues
1views

🚀 SvelteKit Query Params Made Simple

Treat URL query parameters like any other Svelte store.

sveltekit-search-params is a lightweight TypeScript library by paoloricciuti that lets you read and write query parameters in SvelteKit apps without manual URL parsing. It wraps the page's query string into a reactive store, so changes to the store automatically update the URL and vice versa.

✨ Highlights

  • Read all parameters: call queryParameters() to get an object of current query params.
  • Write to store: assign values like params.username = 'foo' and the URL updates automatically.
  • Declare expected parameters: pass an object to queryParameters to predefine keys, missing ones default to null.
  • Encode/decode types: specify encode and decode functions to convert between strings and booleans, numbers, arrays, etc.
  • Default values: use defaultValue to set a fallback when the param is absent.
  • Helper encodings: built‑in helpers for common conversions reduce boilerplate.

💡 Why it matters

Unlike manual window.location.search parsing, this library provides a two‑way binding that respects Svelte's reactivity and works seamlessly with server‑side rendering. The ability to define expected parameters and custom encoders makes it easy to keep type safety and avoid URL injection issues. It's perfect for search filters, pagination, or any UI state that should be shareable via URL.


#SvelteKit #QueryParams #OpenSource #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
VERT-sh/VERT

The next-generation file converter. Open source, fully local* and free forever.

16.4k
Nov 27, 2026
RepositoryTypeScript
huggingface/chat-ui

The open source codebase powering HuggingChat

11.1k
Nov 30, 2026
RepositoryTypeScript
47ng/nuqs

Type-safe search params state manager for React frameworks - Like useState, but stored in the URL query string.

10.9k
Dec 1, 2026
RepositoryTypeScript
huntabyte/shadcn-svelte

shadcn/ui, but for Svelte. ✨

9.3k
Nov 25, 2026
RepositoryTypeScript
pheralb/svgl

🧩 A beautiful library with SVG logos. Built with Sveltekit & Tailwind CSS.

6.4k
Dec 1, 2026
RepositoryTypeScript
skeletonlabs/skeleton

Skeleton is an adaptive design system powered by Tailwind CSS.

6.1k
Dec 1, 2026
RepositoryTypeScript
EpicenterHQ/epicenter

Where one person's software lives.

4.8k
Nov 27, 2026
RepositoryTypeScript
huntabyte/bits-ui

The headless components for Svelte.

3.7k
Nov 30, 2026
RepositorySvelte
serge-chat/serge

A web interface for chatting with Alpaca through llama.cpp. Fully dockerized, with an easy to use API.

5.7k
Nov 21, 2025