sveltekit-search-params
- A SvelteKit library for reading and writing query parameters with ease
- Designed specifically for SvelteKit (won't work with regular Svelte projects)
- Provides reactive query parameter management that automatically updates the URL
- Supports both reading and writing query parameters as if they were regular state
Key Features:
- Simple API to access all query parameters (
queryParameters()
) or single parameters (queryParam()
) - Type conversion helpers for common data types (boolean, number, array, object)
- Default value support for parameters
- Custom encoding/decoding for complex data types
- Configurable history behavior (debouncing, push/pop state)
- Automatic URL updates when parameters change
Target Audience:
- SvelteKit developers needing robust query parameter management
- Projects requiring complex state management via URL parameters
- Applications that need to maintain state in shareable URLs
Notable SvelteKit Integration:
- Uses SvelteKit-specific APIs (won't work outside SvelteKit)
- Supports Svelte 5 runes syntax (v4+)
- Includes Vite plugin for compatibility
Helper Functions (ssp
):
boolean()
- For boolean parametersnumber()
- For numeric parametersarray()
- For array parametersobject()
- For object parametersstring()
- For string parameters (mainly for consistency)lz()
- For compressed JSON state
Migration Note: Version 4+ uses Svelte 5 runes syntax - legacy store-based API (v3) is still available but documented separately.
query-paramssearch-paramssveltesvelte-storesvelte-storessveltekithacktoberfest
Featured Stories
No featured articles here. Navigate to an article, then pick the Feature on menu button