{"repo":"rtrampox/nuqs-svelte","free":true,"listed":false,"github":"https://github.com/rtrampox/nuqs-svelte","clone":"git clone https://github.com/rtrampox/nuqs-svelte.git","description":"nuqs port for Svelte ✨","language":"TypeScript","stars":106,"topics":["nuqs","nuqs-alternative","query-string","searchparams","svelte","sveltekit","url","url-states"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"nuqs-svelte nuqs-svelte is an unnoficial Svelte port of nuqs library. Type-safe search params state manager for Svelte. Like $state() , but stored in the URL query string. Features - 🔀 new: Supports SvelteKit, and custom routers via adapters - 🧘‍♀️ Simple: the URL is the source of truth - 🕰 Replace history or append to use the Back button to navigate state updates - ⚡️ Built-in parsers for common state types (integer, float, boolean, Date, and more). Create your own parsers for custom types & pretty URLs - ♊️ Related querystrings with useQueryStates - 📡 Shallow mode by default for URL query updates Installation Adapters You will need to wrap your Svelte component tree with an adapter. (expand the appropriate section below) SvelteKit Supported Svelte versions: =5.0.0 . Usage useQueryState takes one required argument: the key to use in the query string. It returns an object with the value present in the query string as a string (or null if none was found). Example outputs for our hello world example: URL name value Notes ------------ ---------- ----------------------------------------------------------------- / null No name key in URL /?name= '' Empty string /?name=foo 'foo' /?name=2 '2' Always returns a string by default, see Parsing below Parsing If your state type is not a string, you must pass a parsing function in the second argument object. We provide parsers for common and more advanced object types: You may pass a custom set of parse and serialize functions: Note: p","default_branch":null,"files":null,"tree":[],"storefront":"/r/rtrampox","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rtrampox/nuqs-svelte/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}