svelte-use-persist
- Purpose: A Svelte action that automatically saves form and input values to local storage (or custom stores) and restores them on page load, preventing data loss during navigation or page refreshes.
- Target Audience: Svelte developers who need persistent form data, particularly for long forms or applications where user input retention is critical.
- Key Features:
- Persists various input types (text, email, checkbox, radio, etc.) and form elements.
- Supports custom stores for alternative storage solutions.
- Works with
<form>
elements or individual inputs (requiresname
attributes).
- Framework Support: Exclusively for Svelte (not compatible with SvelteKit's snapshot feature).
- Demo: Try it out here! ↗
- Use Case: Originally created for long audit forms (70+ questions) to prevent user frustration from lost data.
- Inspiration: Built with inspiration from svelte-persisted-store ↗ and Svelte’s ecosystem.
formssveltesveltekit
Author
Featured Stories
No featured articles here. Navigate to an article, then pick the Feature on menu button